Conversation
…ilure Agent-Logs-Url: https://github.com/kimocoder/wifite2/sessions/d321db34-e47f-4e6c-8d63-6ccf66351fd5 Co-authored-by: kimocoder <4252297+kimocoder@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix OIDC token fetch failure in workflow
fix(ci): remove pull_request trigger from Claude workflow to fix OIDC token failure
Apr 9, 2026
There was a problem hiding this comment.
Pull request overview
Updates the Claude Code GitHub Actions workflow to avoid running in the pull_request event context where GitHub withholds OIDC token env vars, preventing anthropics/claude-code-action@v1 from failing on PR open/sync.
Changes:
- Removed the
pull_requesttrigger from.github/workflows/claude.yml. - Kept only comment-driven triggers (
issue_commentandpull_request_review_comment) so the workflow runs in a trusted context compatible with OIDC.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
anthropics/claude-code-action@v1was failing on every PR open/sync event because GitHub does not exposeACTIONS_ID_TOKEN_REQUEST_URLto workflows triggered bypull_request(a platform-level security restriction —id-token: writepermission alone is insufficient in this context).Change
pull_request: [opened, synchronize]trigger from.github/workflows/claude.ymlissue_commentandpull_request_review_commentevents, which run in a trusted context where OIDC tokens are availableNo functional loss — the workflow already gates execution on
trigger_phrase: "@claude", so it was always comment-driven by design.Original prompt
The GitHub Actions workflow in repository
kimocoder/wifite2is failing for PR job 70624417199 in run 23982500564 (PR #479). The failing workflow file is.github/workflows/claude.yml.Observed failure from logs:
anthropics/claude-code-action@v1fails to fetch an OIDC token.Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variableCould not fetch an OIDC token. Did you remember to add id-token: write to your workflow permissions?Relevant context:
permissions: id-token: write contents: write pull-requests: write issues: writepull_requestwith types[opened, synchronize]issue_commentwith types[created]pull_request_review_commentwith types[created]uses: anthropics/claude-code-action@v1anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}and comment-trigger configuration.Goal:
Create a pull request that fixes the workflow so this failure no longer occurs.
Preferred fix:
.github/workflows/claude.ymlso the Claude Code action does not run in the failingpull_requestcontext where the OIDC env vars are unavailable.pull_requesttrigger entirely and keep only comment-driven triggers (issue_commentandpull_request_review_comment), since the workflow is already configured withtrigger_phrase: "@claude"and is naturally comment-driven.Alternative acceptable fix:
pull_requesttrigger but ensure the Claude action step is skipped whengithub.event_name == 'pull_request'.Implementation requirements:
.github/workflows/claude.ymlunless another tiny workflow-only change is clearly necessary.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The failure is in the workflow itself, not in repo code.
Root cause
The job fails while running
anthropics/claude-code-action@v1because it cannot obtain an OIDC token:Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variableCould not fetch an OIDC token. Did you remember to add id-token: write to your workflow permissions?Your workflow already includes
id-token: writein.github/workflows/claude.ymlat lines 14–18, so the real issue is that this run is from a pull_request context where GitHub is not exposing the OIDC request env vars to the action in this scenario.The failing step is the action usage at lines 24–27.
Fix
Avoid running this action on
pull_requestevents, or switch to an event that has the required token context, such asissue_comment/ review-comment only.Recommended workflow change
Update
.github/workflows/claude.ymlso the Claude job only runs for comment-triggered events:If you must keep
pull_requestGate the step so it skips on PR events:
Why this is the right fix
This pull request was created from Copilot chat.