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 });