Skip to content

fix: use actions_variables instead of variables for GitHub API key - #998

Merged
waynesun09 merged 1 commit into
mainfrom
fix/actions-variables-permission-key
May 15, 2026
Merged

fix: use actions_variables instead of variables for GitHub API key#998
waynesun09 merged 1 commit into
mainfrom
fix/actions-variables-permission-key

Conversation

@rh-hemartin

@rh-hemartin rh-hemartin commented May 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix JSON tag in AppPermissions.Variables from "variables" to "actions_variables" to match GitHub's API field name
  • Fix fullsend role in mint rolePermissions to use "actions_variables" key so minted tokens actually receive the permission

Closes #997
Related: #996

How to verify

Check the app's permissions as GitHub returns them:

gh api apps/fullsend-fullsend --jq '.permissions'

The key for repo variables is actions_variables, not variables.

Test plan

  • go vet passes on both modules
  • go test ./internal/forge/github/ passes
  • go test ./... passes in mint module
  • make lint passes

🤖 Generated with Claude Code

GitHub's API uses "actions_variables" not "variables" for the repo
variables permission. Wrong key caused false "missing permissions"
warnings in the installer and silent 403s from minted tokens.

Closes #997

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

fullsend review is working on this — view logs

@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://ff03a0ba-site.fullsend-ai.workers.dev

Commit: 49c91f9c14566cde19fce389f4e459907ebbbe72

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified against the live API — gh api apps/fullsend-fullsend --jq '.permissions' confirms the key is actions_variables, not variables. GitHub docs don't list this key in the installation token schema, but the API uses it. Fix is correct and surgical.

@fullsend-ai-review

Copy link
Copy Markdown

Review: #998

Head SHA: 49c91f9
Timestamp: 2026-05-15T14:00:00Z
Outcome: approve

Summary

This is a correct, minimal bug fix. The two changes — updating the JSON struct tag on AppPermissions.Variables from "variables" to "actions_variables", and the corresponding key in the fullsend entry of rolePermissions — align the codebase with GitHub's actual API field name. The fix resolves two concrete bugs: false-positive stale-permission warnings from checkPermissions (which marshals AppPermissions to JSON for key comparison), and silent 403 errors when minted tokens request the unrecognized "variables" scope. The change is well-scoped to the linked issue #997 and does not introduce new capability.

Findings

Medium

  • [correctness] internal/appsetup/appsetup_test.go:466-476TestSetup_CorrectPermissions_NoError uses a fake installation that is missing "actions_variables": "read" (and was already missing the pre-fix "variables": "read"). This is a pre-existing test bug — the test should have been catching the original mismatch but didn't appear in the PR author's test runs, likely because the test was already silently failing or not included in the targeted test commands. Adding "actions_variables": "read" to the fake installation's permissions map would make this test meaningful.
    Remediation: Add "actions_variables": "read" to the fake installation permissions in TestSetup_CorrectPermissions_NoError (line 466).

Low

Footer

Outcome: approve
This review applies to SHA 49c91f9c14566cde19fce389f4e459907ebbbe72. Any push to the PR head clears this review and requires a new evaluation.

@waynesun09
waynesun09 added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit 18f61fd May 15, 2026
47 checks passed
@waynesun09
waynesun09 deleted the fix/actions-variables-permission-key branch May 15, 2026 13:47
waynesun09 added a commit that referenced this pull request May 15, 2026
PR #998 renamed the JSON key from variables to actions_variables.
Update the test map key to match.

Signed-off-by: Wayne Sun <gsun@redhat.com>
ben-alkov pushed a commit to ben-alkov/fullsend that referenced this pull request May 15, 2026
Replace the partial 5-flag "Additional mint flags" table with a
comprehensive reference covering all 18 admin install flags. Add
sections for admin analyze and admin uninstall commands. Update
OAuth scope table for per-repo distinctions. Update ADR 0033
shared flags list. Reflect --skip-mint-check (PR fullsend-ai#998), --app-set
(PR fullsend-ai#994), and --inference-wif-provider validation (PR fullsend-ai#1010).

Signed-off-by: Wayne Sun <gsun@redhat.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.

fix: use actions_variables instead of variables for GitHub API permission key

3 participants