PR (Actions) #184
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
| name: PR (Actions) | |
| # Triggered when "PR (Check)" completes. Downloads the artifact produced by | |
| # the upstream workflow and applies the recorded actions (sticky comments, | |
| # label changes, close, etc.) with write permissions. Never executes PR | |
| # source code — only reads the JSON artifact. | |
| on: | |
| workflow_run: | |
| workflows: ["PR (Check)"] | |
| types: [completed] | |
| jobs: | |
| actions: | |
| name: PR (Actions) | |
| if: > | |
| github.event.workflow_run.conclusion == 'success' && | |
| github.repository == 'remix-run/react-router' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| actions: read | |
| steps: | |
| # Check's out the base (main) branch - not the PR branch | |
| - name: ⬇️ Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: 📦 Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: ⎔ Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: pnpm | |
| - name: 📥 Install deps | |
| run: pnpm install --frozen-lockfile | |
| - name: 📥 Download result from upstream workflow | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: pr-checks-result | |
| github-token: ${{ github.token }} | |
| run-id: ${{ github.event.workflow_run.id }} | |
| - name: 💬 Apply actions | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: node scripts/pr.ts actions pr-checks-result.json |