Skip to content

Conversation

@Dave-London
Copy link
Contributor

Summary

  • Adds steps.run.outputs.github_token != '' condition to the "Revoke app token" cleanup step
  • Prevents confusing "Bad credentials" 401 error when the prepare phase fails before acquiring a token

Problem

The "Revoke app token" step runs with if: always(), meaning it executes even when the prepare phase fails (e.g., track_progress used with an unsupported event type). When no token was acquired, the curl sends an empty Authorization: Bearer header, producing a 401 "Bad credentials" error that confuses users debugging the actual failure.

Changes

  • action.yml: Added steps.run.outputs.github_token != '' to the existing if condition on the "Revoke app token" step

Test plan

  • TypeScript typecheck passes
  • Prettier formatting passes
  • When prepare fails: token output is empty -> step is skipped -> no 401 error
  • When prepare succeeds: token output is populated -> step runs normally -> token revoked

Fixes #858

Add a check for non-empty github_token output before attempting to
revoke the app token in the cleanup step. When the prepare phase fails
(e.g., unsupported event type with track_progress), no token is
acquired, causing the cleanup curl to send an empty Bearer token
and produce a confusing "Bad credentials" 401 error.

Fixes anthropics#858

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.

Cleanup step shows 'Bad credentials' error when prepare phase fails

1 participant