ci: install prettier-autofix caller#8
Conversation
|
|
||
| jobs: | ||
| prettier-autofix: | ||
| uses: topcoder1/ci-workflows/.github/workflows/prettier-autofix.yml@main |
There was a problem hiding this comment.
Supply chain risk — mutable ref pinned to @main.
@main is a mutable pointer. Any push to topcoder1/ci-workflows main branch takes effect here immediately with no review gate in this repo. Combined with contents: write + secrets: inherit, a compromise of that repo gives an attacker write access to this repo's contents and all its secrets.
Pin to an immutable commit SHA instead:
| uses: topcoder1/ci-workflows/.github/workflows/prettier-autofix.yml@main | |
| uses: topcoder1/ci-workflows/.github/workflows/prettier-autofix.yml@<COMMIT_SHA> |
After each intentional upgrade, bump the SHA with a reviewed commit here.
| jobs: | ||
| prettier-autofix: | ||
| uses: topcoder1/ci-workflows/.github/workflows/prettier-autofix.yml@main | ||
| secrets: inherit |
There was a problem hiding this comment.
Over-broad secret exposure — secrets: inherit passes all repo secrets.
The PR description says only AUTOMERGE_PAT is needed, but secrets: inherit forwards every secret in this repository (any API keys, tokens, etc.) to the reusable workflow. Scope it to only what the callee actually requires:
| secrets: inherit | |
| secrets: | |
| AUTOMERGE_PAT: ${{ secrets.AUTOMERGE_PAT }} |
|
Flagged 2 issues inline — supply chain risk from |
Wires the
topcoder1/ci-workflowsprettier-autofix reusable. When a PR lands with markdown that failsprettier --check(run bylint.yml), this workflow runsprettier --writeon the changed files, commits the result asstyle: prettier auto-fix, and pushes back to the branch. The downstream lint check then re-runs on the new SHA and goes green automatically.Pairs with the existing
lint.ymlprettier check — they read the samemarkdown_globandchanged_onlysemantics.No new secret required: reuses the existing
AUTOMERGE_PATrepo secret (same oneclaude-author-automerge.ymlalready consumes) viasecrets: inherit. Pushes by the defaultGITHUB_TOKENdo not retriggerpull_requestworkflows, so a PAT push is required for the lint check to clear automatically.Skipped automatically on fork PRs and PRs that touch zero markdown.
🤖 Auto-installed via install-prettier-autofix.sh. See runbooks/prettier-autofix.md for rotation + troubleshooting.