mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-28 16:58:31 +01:00
The label sync was the only workflow that read PULSE_TRIAGE_APP_PRIVATE_KEY. That key belongs to an App installation that can administer the repository, and as a repository-level Actions secret any workflow run on any branch could read it. Everything the helper does (read the issue, create, add and remove labels) is covered by the run's own GITHUB_TOKEN with issues: write, so the App key can now be deleted from Actions. The policy test now requires issue-mutating workflows to use the scoped GITHUB_TOKEN and to reference no secrets, and still requires the parser tests to run before the label write. Silent labels are applied as github-actions[bot]; AI_TRANSPARENCY.md says so.
56 lines
1.8 KiB
YAML
56 lines
1.8 KiB
YAML
name: Issue Version Label Sync
|
|
|
|
on:
|
|
issues:
|
|
types:
|
|
- opened
|
|
- edited
|
|
- reopened
|
|
|
|
# Labels are written with the workflow's own GITHUB_TOKEN, scoped to issues.
|
|
# No repository secret is needed, so the triage App key stays out of Actions.
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
|
|
jobs:
|
|
sync:
|
|
if: ${{ github.event.issue.pull_request == null }}
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Check out triage helper and locked parser
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
sparse-checkout: |
|
|
.github/scripts/issue-version-triage.cjs
|
|
.github/scripts/issue-version-triage.test.cjs
|
|
.github/scripts/triage-comment-policy.test.cjs
|
|
.github/scripts/package.json
|
|
.github/scripts/package-lock.json
|
|
.github/ISSUE_TEMPLATE
|
|
.github/workflows
|
|
docs/ISSUE_TRIAGE.md
|
|
sparse-checkout-cone-mode: false
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: '24'
|
|
package-manager-cache: false
|
|
|
|
- name: Install locked parser without lifecycle scripts
|
|
run: npm ci --ignore-scripts --no-audit --no-fund --prefix .github/scripts
|
|
|
|
- name: Verify silent triage before writing labels
|
|
run: npm run test:triage --prefix .github/scripts
|
|
|
|
- name: Sync issue version metadata
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
github-token: ${{ github.token }}
|
|
script: |
|
|
const triage = require(`${process.env.GITHUB_WORKSPACE}/.github/scripts/issue-version-triage.cjs`);
|
|
await triage.syncLabels({ github, context, core });
|