Skip to content

feat: implement issue #492 — [Fleet Monitor] petry-projects/.github-private — issue-triage-runner.yml - #493

Merged
don-petry merged 4 commits into
mainfrom
dev-lead/issue-492-20260608-1116
Jun 8, 2026
Merged

feat: implement issue #492 — [Fleet Monitor] petry-projects/.github-private — issue-triage-runner.yml#493
don-petry merged 4 commits into
mainfrom
dev-lead/issue-492-20260608-1116

Conversation

@don-petry

@don-petry don-petry commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Closes #492

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • Tests
    • Improved CI workflow triggers to run tests for automation scripts and issue-triage configuration on pull requests and pushes.
    • Added structural regression tests that validate workflow configuration, permissions handling, job dependencies, and credential forwarding to reduce workflow failures and improve reliability.

@don-petry
don-petry requested a review from a team as a code owner June 8, 2026 11:28
Copilot AI review requested due to automatic review settings June 8, 2026 11:28
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 39 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d33bf09c-711b-4efe-9a94-f7475803d1c9

📥 Commits

Reviewing files that changed from the base of the PR and between 3698dcc and f29bbd0.

📒 Files selected for processing (1)
  • tests/aw/issue-triage/test_runner_yml.sh
📝 Walkthrough

Walkthrough

Adds path filters to .github/workflows/test-aw.yml and a new test-issue-triage job, and introduces tests/aw/issue-triage/test_runner_yml.sh, a bash structural-regression script that validates .github/workflows/issue-triage-runner.yml across seven YAML/assertion checks.

Changes

Issue-Triage Workflow Testing Infrastructure

Layer / File(s) Summary
Workflow test trigger and job setup
.github/workflows/test-aw.yml
Path filters for scripts/aw.sh and .github/workflows/issue-triage*.yml added to pull_request and push. A new test-issue-triage job installs PyYAML and runs test_aw_run.sh and test_runner_yml.sh.
Issue-triage runner YAML validation tests
tests/aw/issue-triage/test_runner_yml.sh
Bash test harness implements seven checks for .github/workflows/issue-triage-runner.yml: file existence; top-level permissions: {}; jobs.triage.permissions.issues: read; jobs.apply.permissions.issues: write; “Install claude” step uses run (not uses); at least one triage step sets CLAUDE_CODE_OAUTH_TOKEN in env; and jobs.apply has needs: triage plus an if: condition containing skip.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references implementing issue #492 for the issue-triage-runner.yml workflow, which aligns with the main objective of fixing the critical workflow failure.
Linked Issues check ✅ Passed The PR addresses issue #492 by implementing structural regression tests and workflow configuration updates to fix the critical 100% failure rate of issue-triage-runner.yml.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the issue-triage-runner.yml workflow: updated GitHub Actions triggers and added regression tests for the workflow.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-492-20260608-1116

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #493
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-08T11:59:15Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-08T11:59:15Z

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 11:29
@don-petry
don-petry disabled auto-merge June 8, 2026 11:29

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new bash script, test_runner_yml.sh, which performs structural regression tests on the GitHub Actions workflow .github/workflows/issue-triage-runner.yml using Python's yaml module. The review feedback focuses on improving the robustness and debuggability of the test script. Key recommendations include adding pre-flight checks for python3 and PyYAML dependencies, removing stderr redirections (2>/dev/null) to prevent silencing Python or YAML parsing errors, and refining newline handling in error reporting by using $'\n' and printf '%s'.

Comment thread tests/aw/issue-triage/test_runner_yml.sh
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Files changed: none
Skipped (informational): Quality Gate passed — 0 new issues, 0 security hotspots reported.
  No open review threads from sonarqubecloud[bot] to resolve.
  No Tier 1 CI blockers present.
```
No changes are needed. The PR is clean per SonarQube and all checks pass.

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated regression coverage around the issue-triage-runner.yml workflow to prevent a repeat of issue #492 (workflow failing during “Set up job” due to an unreachable external action), and wires those checks into the existing AW test workflow.

Changes:

  • Added a new structural test script that validates key invariants of .github/workflows/issue-triage-runner.yml (permissions model, two-job pattern, and avoiding external setup actions).
  • Updated .github/workflows/test-aw.yml to run the new issue-triage unit + structural tests and to trigger when the issue-triage workflow files change.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
tests/aw/issue-triage/test_runner_yml.sh New bash-based structural regression tests for issue-triage-runner.yml.
.github/workflows/test-aw.yml Runs the new issue-triage test suite in CI and expands path triggers to include issue-triage files.

Comment thread tests/aw/issue-triage/test_runner_yml.sh
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/aw/issue-triage/test_runner_yml.sh`:
- Line 25: Replace the POSIX test bracket in the conditional that checks the
RUNNER file existence by using Bash's safer double-bracket form: change the line
using if [ -f "$RUNNER" ]; then to use [[ -f "$RUNNER" ]] (retain the RUNNER
variable and quoting) so the script uses the bash builtin conditional instead of
[ ].
- Around line 19-20: REPO_ROOT and RUNNER are defined as constants but not
marked readonly; update the assignments for REPO_ROOT and RUNNER (the variables
named REPO_ROOT and RUNNER in this script) to be readonly so they cannot be
modified at runtime—use either the readonly keyword at definition or assign
first and then run readonly VAR (e.g., set them as readonly immediately after
assignment) to follow the coding guideline.
- Around line 37-50: The Python check in the heredoc is too permissive: replace
the current conditional that allows None (the line checking wf['permissions']
not in ({}, None)) with a strict equality check that requires wf['permissions']
== {} so the test only passes when top-level permissions are exactly an empty
dict; update the inline script in the runner check (the heredoc block executed
by python3) to exit nonzero unless 'permissions' exists and equals {}.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 635bc5a1-592b-4dd8-bf96-83e529c3ea0a

📥 Commits

Reviewing files that changed from the base of the PR and between d7cacba and 05d4b6b.

📒 Files selected for processing (2)
  • .github/workflows/test-aw.yml
  • tests/aw/issue-triage/test_runner_yml.sh

Comment thread tests/aw/issue-triage/test_runner_yml.sh
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
@don-petry
don-petry disabled auto-merge June 8, 2026 11:35
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 8, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 8, 2026
@don-petry
don-petry disabled auto-merge June 8, 2026 11:39
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: fix-reviews)

PR: #493
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-08T12:10:56Z

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 11:41
@don-petry
don-petry disabled auto-merge June 8, 2026 16:17
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (no-changes)

Agent reasoning
Addressed 0 threads:
  (none — all review threads were already resolved before this run)
Test verification: PASS
  runner: file exists                                     PASS
  runner: top-level permissions: {} restricts default token  PASS
  runner: triage job has issues:read                      PASS
  runner: apply job has issues:write                      PASS
  runner: Install claude CLI uses run: (not an external action)  PASS
  runner: CLAUDE_CODE_OAUTH_TOKEN is forwarded             PASS
  runner: apply job depends on triage and gates on skip   PASS
  Results: 7 passed, 0 failed
Files changed: none
```
The PR is unblocked — all CI green, all threads resolved, coderabbitai approved. It is waiting for a human approval from a `petry-projects` member.

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 16:18
@don-petry
don-petry disabled auto-merge June 8, 2026 17:34

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/aw/issue-triage/test_runner_yml.sh (1)

138-147: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Scope Test 6 to the actual triage invocation step, not any step env.

This assertion currently succeeds if CLAUDE_CODE_OAUTH_TOKEN appears on any triage step, so it can miss a broken Run issue-triage (staged) step and report a false pass.

Suggested patch
 triage_steps = wf.get('jobs', {}).get('triage', {}).get('steps', [])
-for step in triage_steps:
-    env = step.get('env') or {}
-    if 'CLAUDE_CODE_OAUTH_TOKEN' in env:
-        sys.exit(0)
-sys.exit(1)
+target = None
+for step in triage_steps:
+    if (step.get('id') == 'run'
+        or (step.get('name') or '').strip().lower() == 'run issue-triage (staged)'):
+        target = step
+        break
+
+if not target:
+    print("triage invocation step not found", file=sys.stderr)
+    sys.exit(1)
+
+env = target.get('env') or {}
+if 'CLAUDE_CODE_OAUTH_TOKEN' not in env:
+    print("CLAUDE_CODE_OAUTH_TOKEN missing on triage invocation step", file=sys.stderr)
+    sys.exit(1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/aw/issue-triage/test_runner_yml.sh` around lines 138 - 147, The current
check scans every triage step's env and passes if any step contains
CLAUDE_CODE_OAUTH_TOKEN; change it to locate the specific triage invocation step
(e.g., inspect triage_steps and find the step where step.get('name') == "Run
issue-triage (staged)" or where the run command matches the runner invocation),
then only check that step's env for 'CLAUDE_CODE_OAUTH_TOKEN' and exit 0 if
present (otherwise exit 1); update the loop that builds triage_steps and the
conditional that inspects step.get('env') so it targets that named invocation
instead of any triage step.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tests/aw/issue-triage/test_runner_yml.sh`:
- Around line 138-147: The current check scans every triage step's env and
passes if any step contains CLAUDE_CODE_OAUTH_TOKEN; change it to locate the
specific triage invocation step (e.g., inspect triage_steps and find the step
where step.get('name') == "Run issue-triage (staged)" or where the run command
matches the runner invocation), then only check that step's env for
'CLAUDE_CODE_OAUTH_TOKEN' and exit 0 if present (otherwise exit 1); update the
loop that builds triage_steps and the conditional that inspects step.get('env')
so it targets that named invocation instead of any triage step.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5d173a7a-a147-4f33-af82-9ef263673ad6

📥 Commits

Reviewing files that changed from the base of the PR and between 05d4b6b and 3698dcc.

📒 Files selected for processing (1)
  • tests/aw/issue-triage/test_runner_yml.sh

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #493
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-08T18:05:47Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-08T18:05:47Z

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 17:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3698dcc1f1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
Comment thread tests/aw/issue-triage/test_runner_yml.sh Outdated
@don-petry
don-petry disabled auto-merge June 8, 2026 17:36
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #493
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-08T18:09:42Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-08T18:09:42Z

@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 17:39
@don-petry
don-petry disabled auto-merge June 8, 2026 17:40
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Files changed: none
Skipped (informational): 0
No-changes verdict: VALID
  - Quality Gate passed with 0 new issues and 0 security hotspots
  - No open review threads from sonarqubecloud[bot] to resolve or reply to
  - No Tier 1 blockers (all CI checks green; no CHANGES_REQUESTED reviews)
  - Diff scan found no curl|bash, hardcoded credentials, eval injection,
    or insecure HTTP download patterns in the changed files
```

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 17:41

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: f29bbd0ae5f863e3d2afffb37932e4f7725058b6
Review mode: triage-approved (single reviewer)

Summary

Tests-only PR adding structural regression guards for .github/workflows/issue-triage-runner.yml plus CI wiring in test-aw.yml. Directly addresses the failure mode from #492 (workflow failing at "Set up job" because the anthropics/claude-code-action/setup@<SHA> action became unreachable) by asserting the install step uses run: instead of an external uses:, alongside permissions, two-job pattern, and token-forwarding invariants. No production code touched.

Linked issue analysis

Closes #492 (Fleet Monitor: issue-triage-runner.yml 100% failure rate). The PR substantively addresses it via Test 5, which explicitly fails if the Install claude CLI step is changed back to an external uses: step — the exact regression that caused 6/6 runs to fail at Set-up-job in ~5s. The other six tests lock in the surrounding invariants (top-level permissions: {}, triage issues:read / apply issues:write, token forwarded to the id: run step, two-job pattern with skip gate) so adjacent regressions are also caught. Verified the current issue-triage-runner.yml satisfies all seven assertions, and the "Test issue-triage" CI job is green.

Findings

No issues found.

  • Test script uses set -euo pipefail, [[ ]] brackets, readonly constants — earlier CodeRabbit nits resolved in current HEAD.
  • Test 6 now correctly targets the step with id: run rather than scanning all triage steps (resolves the 17:35 CodeRabbit comment on commit 3698dcc).
  • Test 2 enforces strict permissions == {} equality (no None fallback).
  • actions/checkout is pinned by commit SHA with a version comment.
  • ShellCheck, bats, gh-aw-compile, CodeQL, SonarCloud, AgentShield, gitleaks all SUCCESS. The one CANCELLED check is an earlier review run superseded by a later SUCCESS — not a real failure.

CI status

All checks passing. The single CANCELLED entry is a superseded "PR Review Agent / review" run; a later run of the same workflow completed SUCCESS. SonarCloud Quality Gate Passed, CodeQL clean, no dependency advisories.


Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.

@don-petry
don-petry merged commit b44a64c into main Jun 8, 2026
30 of 31 checks passed
@don-petry
don-petry deleted the dev-lead/issue-492-20260608-1116 branch June 8, 2026 17:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f29bbd0ae5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +113 to +117
install_steps = [
s for s in triage_steps
if 'claude' in (s.get('name') or '').lower()
and 'install' in (s.get('name') or '').lower()
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject the unreachable setup action anywhere in triage

When a future edit leaves this Install claude CLI run step in place but reintroduces uses: anthropics/claude-code-action/setup@... under another step name, GitHub still resolves that uses action during job setup and the issue-triage run can fail before any shell step runs, while this regression test stays green because it only inspects steps whose name contains both claude and install. Since the test is meant to guard issue #492, scan all triage steps for the forbidden external setup action rather than only the install-named step.

Useful? React with 👍 / 👎.

Comment on lines +150 to +153
env = invocation.get('env') or {}
if 'CLAUDE_CODE_OAUTH_TOKEN' not in env:
print("CLAUDE_CODE_OAUTH_TOKEN not found in env of step id: run", file=sys.stderr)
sys.exit(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate the token source, not just its name

If the invocation step keeps an env key named CLAUDE_CODE_OAUTH_TOKEN but points it at the wrong expression or an empty value, this guard still passes even though scripts/aw.sh run issue-triage will fail when Claude is invoked without the OAuth secret. Since this test is specifically protecting credential forwarding to the real invocation step, also assert that the value is ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}.

Useful? React with 👍 / 👎.

Comment on lines +72 to +75
triage = wf.get('jobs', {}).get('triage', {})
perms = triage.get('permissions', {}) or {}
if perms.get('issues') != 'read':
sys.exit(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require contents:read in the permission guard

With the runner's top-level permissions: {}, the triage job also needs contents: read for its checkout step before it can run scripts/aw.sh; if a future edit drops that permission while leaving issues: read, this test still passes but the private-repo workflow can fail before the triage command runs. Extend the permission assertion here to cover the required checkout permission as well as issue access.

Useful? React with 👍 / 👎.

Comment on lines +168 to +176
apply = wf.get('jobs', {}).get('apply', {})
needs = apply.get('needs', [])
if isinstance(needs, str):
needs = [needs]
if 'triage' not in needs:
print("apply job does not declare 'needs: triage'", file=sys.stderr)
sys.exit(1)
if_cond = str(apply.get('if', ''))
if 'needs.triage.outputs.skip' not in if_cond:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Assert triage exports the outputs apply consumes

If a future edit removes or miswires jobs.triage.outputs.skip/result, this check still passes because it only inspects the apply job's needs and if strings; at runtime needs.triage.outputs.skip/result then resolve empty, so the apply job can run with an empty TRIAGE_RESULT and fail while the structural guard stays green. Add assertions that the triage outputs are mapped to steps.run.outputs.skip and steps.run.outputs.result.

Useful? React with 👍 / 👎.

don-petry added a commit that referenced this pull request Jun 12, 2026
…rivate — issue-triage-runner.yml (#493)

* feat: implement issue #492 — [Fleet Monitor] petry-projects/.github-private — issue-triage-runner.yml

* fix(reviews): address review comments [skip ci-relay]

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 14, 2026
…rivate — issue-triage-runner.yml (#493)

* feat: implement issue #492 — [Fleet Monitor] petry-projects/.github-private — issue-triage-runner.yml

* fix(reviews): address review comments [skip ci-relay]

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet Monitor] petry-projects/.github-private — issue-triage-runner.yml

3 participants