This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into batch-writes
- Loading branch information
Showing
16 changed files
with
268 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,43 +29,6 @@ jobs: | |
- name: Check Vulnerabilities | ||
run: mage -v vuln | ||
|
||
generate-spec: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: fetch history | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19.4 | ||
cache: true | ||
|
||
- name: Install Mage | ||
run: go install github.com/magefile/mage | ||
|
||
- name: Update to latest spec | ||
shell: bash | ||
run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
go install github.com/swaggo/swag/cmd/[email protected] | ||
mage spec | ||
- name: Push generated spec file | ||
uses: actions/checkout@v3 | ||
- run: | | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
if (git diff --shortstat | grep '[0-9]'); then \ | ||
git add .; \ | ||
git commit -m "gen OpenAPI Spec by github-actions"; \ | ||
git push | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: swagger-doc | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
generate-swagger: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19.4 | ||
cache: true | ||
|
||
- name: Install Mage | ||
run: go install github.com/magefile/mage | ||
|
||
- name: Update spec and push generated spec file | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
- run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
mage spec | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
if (git diff --shortstat | grep '[0-9]'); then \ | ||
git checkout -B main_swagger | ||
git add .; \ | ||
git commit -m "gen OpenAPI Spec by github-actions"; \ | ||
git push --set-upstream origin main_swagger | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"credentialManifest": "{{.ManifestID}}", | ||
"issuer": "{{.IssuerID}}", | ||
"credentials": [ | ||
{ | ||
"id": "kyc_credential", | ||
"schema": "{{.SchemaID}}", | ||
"credentialInputDescriptor": "kyc1", | ||
"data": { | ||
"givenName": "$.credentialSubject.givenName", | ||
"familyName": "$.credentialSubject.familyName", | ||
"postalAddress": { | ||
"addressRegion": "CA" | ||
} | ||
}, | ||
"expiry": { | ||
"time": "2022-10-31T00:00:00Z" | ||
}, | ||
"revocable": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,11 @@ func Integration() error { | |
// Spec generates an OpenAPI spec yaml based on code annotations. | ||
func Spec() error { | ||
swagCommand := "swag" | ||
if err := installIfNotPresent(swagCommand, "github.com/swaggo/swag/cmd/swag@latest"); err != nil { | ||
if err := installIfNotPresent(swagCommand, "github.com/swaggo/swag/cmd/[email protected]"); err != nil { | ||
logrus.Fatal(err) | ||
return err | ||
} | ||
if err := sh.Run(swagCommand, "fmt", "-d", "pkg/server/router"); err != nil { | ||
logrus.Fatal(err) | ||
return err | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.