ci: auto-fix schema on /fix-schema comment - #481
Conversation
✅MegaLinter analysis: Success
Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts MegaLinter is graciously provided by OX Security |
| jobs: | ||
| fix: | ||
| name: Regenerate and commit schema | ||
| if: github.event.issue.pull_request != null && contains(github.event.comment.body, '/fix-schema') |
There was a problem hiding this comment.
will this contains rule get triggered when the ci.yml workflow posts Comment /fix-schema on this? Just making sure we avoid an infinite loop.
There was a problem hiding this comment.
no, comments posted with the workflow's GITHUB_TOKEN don't trigger issue_comment events (GitHub blocks that to prevent recursion)...so the CI hint comment can never start the workflow
even if it somehow did, the author_association check only allows MEMBER/OWNER/COLLABORATOR, which does not include the bot.
84f24b2 to
f9bda77
Compare
When
Check CLI schema is up to datefails on a PR, the job now posts a comment pointing to/fix-schema.A new
schema-auto-fixworkflow listens for/fix-schemacomments on PRs and automatically runsnpm run build:schema, commits the result, and pushes it to the PR branch.