Tee the org-permissions diagnostic to the job log - #177
Conversation
$GITHUB_STEP_SUMMARY content isn't retrievable via the REST/GraphQL API -- only the Actions web UI renders it. Tee the same output to stdout too, so it's readable from a normal 'gh run view --log'.
WalkthroughThe permissions-reporting step now uses ChangesPermissions reporting
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 @.github/workflows/apply.yaml:
- Line 97: Update the workflow step containing the jq-to-tee summary pipeline to
enable Bash pipefail, either by declaring shell: bash with pipefail enabled or
by running set -o pipefail before the pipeline, so jq failures propagate instead
of being masked by tee.
🪄 Autofix
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: Repository: osac-project/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2f4dc9a5-8e34-4fee-8c75-a471ec10feaa
📒 Files selected for processing (1)
.github/workflows/apply.yaml
| echo "### Runner-related" | ||
| jq -r '.[] | select(.description | test("runner"; "i")) | "- `\(.name)`: \(.description)"' /tmp/org-perms.json | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
| } | tee -a "$GITHUB_STEP_SUMMARY" |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 4 '(^[[:space:]]*shell:|set -o pipefail|tee -a "\$GITHUB_STEP_SUMMARY")' .github/workflows/apply.yamlRepository: osac-project/github-config
Length of output: 607
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- workflow context ---'
sed -n '1,115p' .github/workflows/apply.yaml
printf '%s\n' '--- shell and pipefail references ---'
rg -n -C 3 '(^[[:space:]]*shell:|set([[:space:]]+-[a-zA-Z]*|[[:space:]]+)?[[:space:]]*[^#]*pipefail|tee -a "\$GITHUB_STEP_SUMMARY")' .github/workflows/apply.yamlRepository: osac-project/github-config
Length of output: 6201
Enable pipefail for the summary pipeline.
This step uses the default bash -e shell, so a failed jq command can be masked by a successful tee. Add shell: bash or run set -o pipefail before the pipeline.
🤖 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 @.github/workflows/apply.yaml at line 97, Update the workflow step containing
the jq-to-tee summary pipeline to enable Bash pipefail, either by declaring
shell: bash with pipefail enabled or by running set -o pipefail before the
pipeline, so jq failures propagate instead of being masked by tee.
The live organization-fine-grained-permissions API rejected manage_organization_runners (422); a one-time diagnostic dispatch (github-config#175, #177) confirmed the real identifier is write_organization_runners_and_runner_groups ("Manage organization runners and runner groups"). Fix the role's permissions list, and remove the diagnostic step and its input entirely -- it was genuinely one-time (unlike exclude_addresses/state_rm_addresses/import_address, which are reusable escape hatches), so apply.yaml is restored to its pre-#175 shape. NO-ISSUE
What
#175's diagnostic dispatch (run 31149352826) worked correctly -- but its output only landed in `$GITHUB_STEP_SUMMARY`, which turns out not to be retrievable via the REST or GraphQL API at all, only rendered in the Actions web UI. Tees the same output to stdout too, so it's readable from `gh run view --log` / the normal job log.
Context
Separately: a second, non-diagnostic dispatch of `apply.yaml` in the meantime hit the same known #173 permission-string failure again and re-filed the apply-failure issue as #176 (after #174 was closed). That's expected -- `organization.tf` still has the broken `manage_organization_runners` string until this diagnostic actually confirms the right one. Once this merges I'll dispatch once more with both `list_org_fine_grained_permissions=true` and `exclude_addresses=github_organization_role.runner_manager,github_organization_role_team.runner_manager_wg_infra` together, to get the real string without re-triggering the failure.
NO-ISSUE
Summary by CodeRabbit