Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 26, 2025

Summary

  • Moved permissions: block from job level to workflow level in claude-code-review.yml
  • Changed pull-requests: read to pull-requests: write to allow commenting on PRs

Problem

  1. The workflow was failing with errors fetching the OIDC token due to missing ACTIONS_ID_TOKEN_REQUEST_URL environment variable. Job-level permissions don't always properly propagate this for actions that require OIDC tokens.
  2. The workflow uses gh pr comment which requires write access to pull requests.

Solution

  • Move permissions to workflow level (below on: and above jobs:)
  • Grant pull-requests: write instead of read to enable commenting

🤖 Generated with Claude Code

Move the `permissions:` block from the job level to the workflow level
to ensure the OIDC token is available for the claude-code-action.

Job-level permissions may not properly propagate the ACTIONS_ID_TOKEN_REQUEST_URL
environment variable needed for id-token: write to function correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@thomhurst thomhurst force-pushed the copilot/fix-oidc-token-permissions branch from 6d13815 to d76ab27 Compare December 27, 2025 16:23
@thomhurst thomhurst changed the title [WIP] Fix OIDC token permission configuration in workflow fix: move permissions to workflow level for OIDC token access Dec 27, 2025
@thomhurst thomhurst marked this pull request as ready for review December 27, 2025 16:23
The workflow uses `gh pr comment` which requires write access to
pull requests, not just read access.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@thomhurst thomhurst merged commit 618593f into main Dec 27, 2025
10 of 13 checks passed
@thomhurst thomhurst deleted the copilot/fix-oidc-token-permissions branch December 27, 2025 16:27
This was referenced Dec 29, 2025
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.

2 participants