ci: bump the all-actions group across 1 directory with 7 updates #154
Workflow file for this run
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: Label Guard | |
| on: | |
| pull_request: | |
| types: [labeled] | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| guard-release-skip: | |
| runs-on: ubuntu-latest | |
| if: >- | |
| github.event.label.name == 'release:skip' && | |
| github.event.sender.login != 'github-actions[bot]' | |
| steps: | |
| - name: Check if release PR | |
| id: check | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const title = pr.title; | |
| const sender = context.payload.sender.login; | |
| // Allow release:skip on release PRs (created by auto-release workflow) | |
| if (title.startsWith('chore(release):')) { | |
| console.log(`Allowing release:skip on release PR: "${title}"`); | |
| core.setOutput('allowed', 'true'); | |
| return; | |
| } | |
| console.log(`User "${sender}" attempted to add release:skip to non-release PR: "${title}"`); | |
| core.setOutput('allowed', 'false'); | |
| - name: Remove unauthorized release:skip label | |
| if: steps.check.outputs.allowed == 'false' | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| name: 'release:skip' | |
| }); | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| body: `The \`release:skip\` label was removed because it can only be applied to release PRs (\`chore(release): ...\`) by the automated release workflow.\n\nAdded by: @${context.payload.sender.login}` | |
| }); |