File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 99jobs :
1010 api-spec :
1111 runs-on : ubuntu-latest
12- name : API specification validation
12+ name : Ensure committed API specification is up to date
1313 steps :
1414 - name : Checkout
1515 uses : actions/checkout@v5
2828 task --yes api:spec:export
2929
3030 - name : Check for changes in specification
31+ id : git-diff-spec
32+ continue-on-error : true
3133 run : git diff --diff-filter=ACMRT --exit-code public/spec.yaml
3234
35+ - name : Comment PR
36+ if : steps.git-diff-spec.outcome == 'failure'
37+ working-directory : head
38+ env :
39+ GH_TOKEN : ${{ github.token }}
40+ run : |
41+ echo "## 🛑 Exported API specification file not up to date" > ../comment.md
42+ echo "" >> ../comment.md
43+ echo "Please run `task api:spec:export` to export the API specification. Then commit and push the changes." >> ../comment.md
44+ gh pr comment ${{ github.event.pull_request.number }} --body-file ../comment.md --create-if-none --edit-last
45+
46+ - name : Fail job api spec is not up to date
47+ if : steps.git-diff-spec.outcome == 'failure'
48+ run : |
49+ exit 1
50+
3351 detect-breaking-changes :
52+ name : Detect breaking changes in API specification
3453 runs-on : ubuntu-latest
3554 needs : [api-spec]
3655 steps :
Original file line number Diff line number Diff line change 11openapi : 3.1.0
2+ # <debug>Force git diff to test github action</debug>
23info :
34 title : ' Event Database'
45 description : ' API for the Event Database'
You can’t perform that action at this time.
0 commit comments