Skip to content

Commit

Permalink
try generate security scheme using go (#383)
Browse files Browse the repository at this point in the history
* try generate security scheme using go

* [AUTOMATED] Update:

* try generate security scheme using go

* [AUTOMATED] Update:

---------

Co-authored-by: LukasJenicek <6400599+LukasJenicek@users.noreply.github.com>
  • Loading branch information
2 people authored and RichardIrala committed Oct 25, 2024
1 parent 9f43405 commit e595655
Show file tree
Hide file tree
Showing 4 changed files with 2,063 additions and 2,075 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ jobs:
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN_GIT_COMMIT }}
with:
src: "docs/pages/api/**/*.gen.yaml"
files: "docs/pages/api/**/*.gen.yaml"
branch: ${{ github.head_ref }}
pr_title: "[AUTOMATED] Merge examples and openapi docs"
## since openapi docs are generated and PR is automatically created there is no need to try create new one
pr_create: false
overwrite: true
overwrite: true
40 changes: 40 additions & 0 deletions .github/workflows/scheme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Scheme
on:
pull_request:
paths:
- "**/*.gen.yaml"

jobs:
securityScheme:
runs-on: ubuntu-latest
name: Add security schemes
steps:
- name: git-checkout
uses: actions/checkout@v4
with:
lfs: true

- name: setup-go
uses: actions/setup-go@v5
with:
go-version: "1.22.5"

- name: Update openapi docs
run: |
# Read the changed files from the previous step
go mod init github.com/0xsequence/docs
go get github.com/mikefarah/yq/v4@latest
go run github.com/mikefarah/yq/v4 -e -i '.security=[{"ApiKeyAuth":[]}]' docs/pages/api/marketplace/marketplace.gen.yaml
go run github.com/mikefarah/yq/v4 -e -i '.security=[{"ApiKeyAuth":[]}, {"BearerAuth":[]}]' docs/pages/api/metadata/metadata.gen.yaml
go run github.com/mikefarah/yq/v4 -e -i '.security=[{"ApiKeyAuth":[]}]' docs/pages/api/indexer/indexer.gen.yaml
- name: Push changes
uses: 0xsequence/actions/git-commit@master
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN_GIT_COMMIT }}
with:
files: "docs/pages/api/**/*.gen.yaml"
branch: ${{ github.head_ref }}
## since openapi docs are generated and PR is automatically created there is no need to try create new one
pr_title: "[AUTOMATED] Add global security schemes"
pr_create: false
Loading

0 comments on commit e595655

Please sign in to comment.