-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export and auto-commit docs/docs/api/openapi.json
as part of test-api-contract
workflow
#719
export and auto-commit docs/docs/api/openapi.json
as part of test-api-contract
workflow
#719
Conversation
@@ -4,6 +4,7 @@ on: | |||
push: | |||
branches: | |||
- main | |||
- add-api-docs-workflow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if/once we happy to merge i will make a final commit to this PR to remove this branch - just needed as part of testing this PR.
❌ pre-commit failed. |
|
||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
file_pattern: "docs/docs/api/openapi.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this ensures will only ever auto-commit for the docs/docs/api/openapi.json
file to reduce risk of any other files accidentally getting autocommited for whatever reason.
❌ pre-commit failed. |
❌ pre-commit failed. |
what happens if the file remains unchanged? no commit? |
yep no commit. just need to make the |
❌ pre-commit failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can also include openapi.json from pre-commit. it's auto-generated, so the formatting is fixed
going to see if can just run pre-commit on the file as part of the script and be done with it that way. If fails then yep - i might add it to the |
❌ pre-commit failed. |
ah i think it's hitting some sort of github error relating to the branch protection stuff - i'll make a quick PR to just turn this step off for now while we try figure it out. |
seems like we need to do this: https://github.com/stefanzweifel/git-auto-commit-action#push-to-protected-branches |
It seems that an
openapi.json
is generated and used as part of thetest-api-contract
workflow. This PR justopenapi.json
file todocs/docs/api/openapi.json
as part ofstart-mock-server.sh
.test-api-contract
workflow that just auto-commits changes to thedocs/docs/api/openapi.json
file.docs/docs/api/openapi.json
frompre-commit
since its already been formatted byjq
.Here is an example of the commit made by the workflow if the file
docs/docs/api/openapi.json
changes.