bf9395e022
CI / license-header (push) Has been skipped
CI / e2e-dry-run (push) Has been skipped
CI / fast-gate (push) Failing after 0s
Test PR Label Logic / test-pr-labels (push) Failing after 1s
Skill Format Check / check-format (push) Failing after 2s
CI / security (push) Failing after 5s
CI / unit-test (push) Has been skipped
CI / lint (push) Has been skipped
CI / script-test (push) Has been skipped
CI / deterministic-gate (push) Has been skipped
CI / coverage (push) Has been skipped
CI / results (push) Has been cancelled
CI / deadcode (push) Has been cancelled
CI / e2e-live (push) Has been cancelled
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: PR Labels
|
|
|
|
on:
|
|
pull_request_target:
|
|
# NOTE: This event runs with base-branch code and write permissions.
|
|
# Do NOT add `ref: github.event.pull_request.head.sha` to the checkout step,
|
|
# as that would execute untrusted PR code with elevated access.
|
|
types:
|
|
- opened
|
|
- edited
|
|
- reopened
|
|
- synchronize
|
|
- ready_for_review
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: write
|
|
|
|
jobs:
|
|
sync-pr-labels:
|
|
if: ${{ github.event.pull_request.state == 'open' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Sync managed PR labels
|
|
id: sync_pr_labels
|
|
# Labeling is best-effort and must not block PR merges.
|
|
continue-on-error: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: node scripts/pr-labels/index.js
|
|
|
|
- name: Warn when label sync fails
|
|
if: ${{ always() && steps.sync_pr_labels.outcome == 'failure' }}
|
|
run: |
|
|
echo "::warning::PR label sync failed; labels may be stale."
|
|
echo "⚠️ PR label sync failed; labels may be stale." >> "$GITHUB_STEP_SUMMARY"
|