Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Sync issue labels with GITHUB_TOKEN, not the triage App key

rcourtmanb3a27e2dd2c4
diff --git a/.github/scripts/issue-version-triage.test.cjs b/.github/scripts/issue-version-triage.test.cjs
index a68d94aad6..f43d54c96c 100644
--- a/.github/scripts/issue-version-triage.test.cjs
+++ b/.github/scripts/issue-version-triage.test.cjs
@@ -1847,12 +1847,12 @@ test("the actual label consumer keeps copied declarations from changing report o
});
-test("triage workflow prepares and checks the exact parser before minting its write token", () => {
+test("triage workflow prepares and checks the exact parser before writing labels", () => {
const workflow = fs.readFileSync(path.resolve(__dirname, "../workflows/issue-version-label-sync.yml"), "utf8");
const install = workflow.indexOf("run: npm ci --ignore-scripts --no-audit --no-fund --prefix .github/scripts");
const check = workflow.indexOf("run: npm run test:triage --prefix .github/scripts");
- const credential = workflow.indexOf("- name: Mint triage bot token");
- assert.ok(install >= 0 && check > install && credential > check);
+ const write = workflow.indexOf("- name: Sync issue version metadata");
+ assert.ok(install >= 0 && check > install && write > check);
assert.match(workflow, /node-version: '24'/);
assert.match(workflow, /actions\/setup-node@[0-9a-f]{40}/);
assert.match(workflow, /persist-credentials: false/);
diff --git a/.github/scripts/triage-comment-policy.test.cjs b/.github/scripts/triage-comment-policy.test.cjs
index 5817c9927d..ea30d030ce 100644
--- a/.github/scripts/triage-comment-policy.test.cjs
+++ b/.github/scripts/triage-comment-policy.test.cjs
@@ -12,7 +12,10 @@ const issueMutationPatterns = [
/syncLabels/,
];
-test("automated workflow issue mutations use the dedicated triage identity", () => {
+// The triage App installation can administer the repository, so its key must
+// not be an Actions secret any workflow on any branch could read. Workflow
+// issue mutations use the run's own GITHUB_TOKEN, scoped to issues.
+test("automated workflow issue mutations use an issues-scoped GITHUB_TOKEN, not a secret", () => {
const publishers = [];
for (const name of fs.readdirSync(workflowDir)) {
@@ -23,19 +26,17 @@ test("automated workflow issue mutations use the dedicated triage identity", ()
publishers.push(name);
assert.match(
workflow,
- /actions\/create-github-app-token@[0-9a-f]{40}/,
- `${name} must mint a pinned GitHub App token`
+ /^permissions:\n contents: read\n issues: write\n(?! )/m,
+ `${name} must grant exactly contents: read and issues: write`
);
+ assert.doesNotMatch(workflow, /^\s+permissions:/m, `${name} must not override permissions per job`);
assert.match(
workflow,
- /private-key: \$\{\{ secrets\.PULSE_TRIAGE_APP_PRIVATE_KEY \}\}/,
- `${name} must use the triage App private key`
- );
- assert.match(
- workflow,
- /github-token: \$\{\{ steps\.triage-token\.outputs\.token \}\}/,
- `${name} must pass the triage App token to github-script`
+ /github-token: \$\{\{ github\.token \}\}/,
+ `${name} must pass the run's GITHUB_TOKEN to github-script`
);
+ assert.doesNotMatch(workflow, /secrets\./, `${name} must not read repository secrets`);
+ assert.doesNotMatch(workflow, /create-github-app-token/, `${name} must not mint an App token`);
}
assert.deepEqual(publishers.sort(), [
diff --git a/.github/workflows/README.md b/.github/workflows/README.md
index 59d7bcea90..874b64996e 100644
--- a/.github/workflows/README.md
+++ b/.github/workflows/README.md
@@ -287,7 +287,7 @@ verify downloaded files offline against the candidate-builder identity.
**File**: `issue-version-label-sync.yml`
- The silent metadata path runs on `opened`, `edited`, and `reopened` issue events. The shared helper at `.github/scripts/issue-version-triage.cjs` maintains version labels, `needs-version-info`, feedback classification and `needs-decomposition`.
-- Its Node 24 job installs the exact locked Markdown lexer with lifecycle scripts disabled, then tests the helper before minting the triage write token. Top-level fields count; quoted, nested, HTML and inline-code examples remain evidence rather than declarations.
+- Its Node 24 job installs the exact locked Markdown lexer with lifecycle scripts disabled, then tests the helper before writing labels. Labels are written with the run's own `GITHUB_TOKEN`, granted only `contents: read` and `issues: write`, so the workflow reads no repository secret. Top-level fields count; quoted, nested, HTML and inline-code examples remain evidence rather than declarations.
- It reads the current report and labels before classifying; failed reads stop without an event-snapshot fallback, and closed issues or pull requests are skipped. A superseded declaration event cannot restore a cleared decomposition task. No release lookup is needed for metadata classification.
- Version-only retest posting and marked-request timeout closure workflows are retired. An older reported version or silence is not evidence of resolution.
- Community owns public follow-up and closure after whole-thread review, relevant-fix verification and confirmed released-source inclusion. The synchronizer neither adds nor removes the community-owned `needs-retest-on-latest` label. Classification uses individual label additions/removals rather than replacing the event snapshot, preserving concurrent Community label decisions. Existing labels and comments are context, not proof that a reporter has or has not replied.
diff --git a/.github/workflows/issue-version-label-sync.yml b/.github/workflows/issue-version-label-sync.yml
index be55401b85..2526f432bb 100644
--- a/.github/workflows/issue-version-label-sync.yml
+++ b/.github/workflows/issue-version-label-sync.yml
@@ -7,8 +7,11 @@ on:
- 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:
@@ -40,20 +43,13 @@ jobs:
- name: Install locked parser without lifecycle scripts
run: npm ci --ignore-scripts --no-audit --no-fund --prefix .github/scripts
- - name: Verify silent triage before obtaining its write credential
+ - name: Verify silent triage before writing labels
run: npm run test:triage --prefix .github/scripts
- - name: Mint triage bot token
- id: triage-token
- uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
- with:
- app-id: 2484142
- private-key: ${{ secrets.PULSE_TRIAGE_APP_PRIVATE_KEY }}
-
- name: Sync issue version metadata
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
- github-token: ${{ steps.triage-token.outputs.token }}
+ github-token: ${{ github.token }}
script: |
const triage = require(`${process.env.GITHUB_WORKSPACE}/.github/scripts/issue-version-triage.cjs`);
await triage.syncLabels({ github, context, core });
diff --git a/docs/AI_TRANSPARENCY.md b/docs/AI_TRANSPARENCY.md
index 4533950c2b..091861ed8b 100644
--- a/docs/AI_TRANSPARENCY.md
+++ b/docs/AI_TRANSPARENCY.md
@@ -31,7 +31,10 @@ released builds still go through Pulse's release qualification process.
claims must stay consistent with the actual published source and checks.
- **Issue triage.** Automated issue and discussion replies post
under the dedicated `pulse-triage` bot identity and link back to this page.
- Automated issue state changes use that identity as well. Mixed reports follow
+ Automated issue state changes use that identity as well, except those made
+ by the repository's own GitHub Actions workflows, which appear as
+ `github-actions[bot]`: silent version and form labels, and the alert issues
+ that scheduled checks open, update and close. Mixed reports follow
the [topic-integrity triage contract](ISSUE_TRIAGE.md): automation can surface
declared secondary topics, but a maintainer or triage agent must give every
actionable topic a linked disposition. Private support email is handled by
diff --git a/frontend-modern/public/docs/AI_TRANSPARENCY.md b/frontend-modern/public/docs/AI_TRANSPARENCY.md
index 4533950c2b..091861ed8b 100644
--- a/frontend-modern/public/docs/AI_TRANSPARENCY.md
+++ b/frontend-modern/public/docs/AI_TRANSPARENCY.md
@@ -31,7 +31,10 @@ released builds still go through Pulse's release qualification process.
claims must stay consistent with the actual published source and checks.
- **Issue triage.** Automated issue and discussion replies post
under the dedicated `pulse-triage` bot identity and link back to this page.
- Automated issue state changes use that identity as well. Mixed reports follow
+ Automated issue state changes use that identity as well, except those made
+ by the repository's own GitHub Actions workflows, which appear as
+ `github-actions[bot]`: silent version and form labels, and the alert issues
+ that scheduled checks open, update and close. Mixed reports follow
the [topic-integrity triage contract](ISSUE_TRIAGE.md): automation can surface
declared secondary topics, but a maintainer or triage agent must give every
actionable topic a linked disposition. Private support email is handled by
diff --git a/scripts/tests/test_ci_browser_proof_only.py b/scripts/tests/test_ci_browser_proof_only.py
index 40b15d9bf1..faf509425f 100644
--- a/scripts/tests/test_ci_browser_proof_only.py
+++ b/scripts/tests/test_ci_browser_proof_only.py
@@ -366,9 +366,9 @@ class WorkflowScopeTest(unittest.TestCase):
self.assertNotIn(forbidden, job)
self.assertLess(job.index("npm ci "), job.index("npm run test:triage"))
# Hosted test admission adds coverage; it never replaces the separate
- # issue-event tests that must still precede credential acquisition.
+ # issue-event tests that must still precede the label write.
live = (ROOT / ".github/workflows/issue-version-label-sync.yml").read_text()
- self.assertLess(live.index("npm run test:triage"), live.index("Mint triage bot token"))
+ self.assertLess(live.index("npm run test:triage"), live.index("Sync issue version metadata"))
def test_actual_triage_recipes_preserve_install_and_test_failures(self):
job = job_block(BUILD.read_text(), "triage-helper")