Skip to content

Commit

Permalink
Merge pull request #11 from lalithkota/develop
Browse files Browse the repository at this point in the history
Reset OpenAPI generate and PUSH githubb workflow
  • Loading branch information
shibu-narayanan authored Dec 22, 2023
2 parents 6d33f3b + d7335fa commit 0221e76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2,026 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/openapi-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,24 @@ jobs:
- name: Generate openapi json
run: |
mkdir -p api-docs/generated
python main.py getOpenAPI api-docs/generated/openapi.json
python3 main.py getOpenAPI api-docs/generated/openapi.json
if ! [ -z "$(git status --porcelain=v1 2>/dev/null -- api-docs/generated/openapi.json)" ]; then
export OPENAPI_CHANGED="true"
echo OPENAPI_CHANGED=$OPENAPI_CHANGED >> $GITHUB_ENV
fi
- name: Commit Changes
uses: EndBug/add-and-commit@v7
if: env.OPENAPI_CHANGED == 'true'
with:
default_author: github_actions
message: "Generated new openapi.json on push to ${{ github.event.inputs.git-ref }}"
add: "api-docs/generated/openapi.json"
- name: Setup nodejs
uses: actions/setup-node@v2
if: env.OPENAPI_CHANGED == true
if: env.OPENAPI_CHANGED == 'true'
with:
node-version: '14'
- name: Publish to stoplight
if: env.OPENAPI_CHANGED == true
if: env.OPENAPI_CHANGED == 'true'
run: |
npx @stoplight/cli@5 push --ci-token ${{ secrets.STOPLIGHT_PROJECT_TOKEN }} --url https://openg2p.stoplight.io --branch ${{ env.BRANCH_NAME }} --directory api-docs/generated
Loading

0 comments on commit 0221e76

Please sign in to comment.