docs+ci: download fork-comment artifact to runner.temp (CodeQL artifact-poisoning) #97
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 🐸 Bumpy CI check (dogfood) | |
| # Runs our own unreleased bumpy on every PR and renders the release-plan comment as an | |
| # artifact. Runs on the UNPRIVILEGED `pull_request` event, so it's safe to build and run | |
| # the PR's own bumpy (fork or not) — there's no write token or secrets to protect here. | |
| # Posting the comment on fork PRs is the privileged half and lives in bumpy-comment.yaml | |
| # (workflow_run). A normal project just adds | |
| # bunx @varlock/bumpy ci check --emit-comment ./bumpy-comment | |
| # to its existing CI workflow. | |
| # | |
| # ⚠️ DO NOT COPY THIS FILE — see the recommended setup in the docs: | |
| # ➡️ https://bumpy.varlock.dev/blob/main/docs/github-actions.md ⬅️ | |
| name: Bumpy Check | |
| on: pull_request | |
| permissions: | |
| pull-requests: write # same-repo PRs comment directly; fork PRs are read-only (the poster handles those) | |
| contents: read | |
| jobs: | |
| # Distinct job name (not "check") so its status context doesn't collide with the | |
| # `check` job in ci.yaml. This is the context to require in branch protection. | |
| bumpy-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 # history to diff bump files against the PR base branch | |
| - uses: oven-sh/setup-bun@v2 | |
| - run: bun install | |
| - run: bun run --filter @varlock/bumpy build | |
| - run: bun install # link the freshly-built CLI bin | |
| - run: bunx @varlock/bumpy ci check --emit-comment ./bumpy-comment | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - uses: actions/upload-artifact@v4 | |
| if: always() # upload even when the check fails — the comment explains why | |
| with: | |
| name: bumpy-comment | |
| path: ./bumpy-comment |