Skip to content

Commit

Permalink
ci: post diff as comment on PRs that modify vocdoni-api.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Aug 30, 2024
1 parent 50c3f98 commit 5cb1711
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,29 @@ jobs:
cmd: |
yq '.components.schemas."api.GenericTransactionWithInfo".properties.tx = load("api/docs/models/transactions.yaml").target' \
api/docs/oas3.yaml > api/docs/vocdoni-api.yaml
- name: Fetch upstream vocdoni-api.yaml
run: |
git add api/docs/vocdoni-api.yaml
curl -o api/docs/vocdoni-api.yaml https://raw.githubusercontent.com/vocdoni/developer-portal/main/swaggers/vocdoni-api.yaml
- name: Check if there is a difference
uses: mathiasvr/[email protected]
id: diff
with:
run: git diff --color api/docs/vocdoni-api.yaml

- name: Post PR comment with diff
if: ${{ steps.diff.outputs.stdout }}
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: "This PR introduces the following changes in the developer-portal documentation:"
message: |
```diff
${{ steps.diff.outputs.stdout }}
```
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit 5cb1711

Please sign in to comment.