Skip to content

Claude PR review use OIDC-free method#560

Open
Micky774 wants to merge 11 commits intodevfrom
zain/claude-pr-review
Open

Claude PR review use OIDC-free method#560
Micky774 wants to merge 11 commits intodevfrom
zain/claude-pr-review

Conversation

@Micky774
Copy link
Copy Markdown
Contributor

@Micky774 Micky774 commented Apr 24, 2026

Description

Updated to consolidate actions into a single workflow, and revised strategy to bypass OIDC exchange, losing official claude bot attribution (posts will be made by a generic GH bot), but bypassing the need for a token w/ elevated permissions.

Fixes # (issue)

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Change A
  • Change B

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Micky774 Micky774 changed the title Claude PR review change GH token env variable Claude PR review use OIDC-free API method Apr 29, 2026
@Micky774 Micky774 changed the title Claude PR review use OIDC-free API method Claude PR review use OIDC-free method Apr 29, 2026
@Micky774 Micky774 requested a review from ipanfilo April 29, 2026 21:20

case "$EVENT_NAME" in
pull_request_target)
case "$LABEL_NAME" in
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you remind me if the labels could only be added by those who has write permissions to the repo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only those w/ triage perm or higher

echo "No matching action; nothing to do."
exit 0
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's also check if the PR number is empty or not:

if [[ -z "$pr" ]]; then
  echo "::error::pr_number is required" >&2
  exit 1
fi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

echo "base=$base" >> "$GITHUB_OUTPUT"

- name: React to comment (acknowledge)
if: steps.resolve.outputs.action != '' && github.event_name == 'issue_comment'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's add the response if the action is neither "review" or "summary" so that the user knows what to do if they mistakenly use other commands.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Same token is exposed to the model's `gh` subprocess so it can
# comment on the PR. Mirrors the `github_token:` input below.
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need another github secret?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No this is automatically provided to the runner

@Micky774 Micky774 requested a review from wenchenvincent April 30, 2026 15:09
@ipanfilo
Copy link
Copy Markdown
Collaborator

ipanfilo commented May 1, 2026

Isn't using OIDC a recommended way?

@Micky774
Copy link
Copy Markdown
Contributor Author

Micky774 commented May 5, 2026

Isn't using OIDC a recommended way?

Yes, however it requires the issuance of an elevated PAT w/ write contents permissions, which is difficult to obtain.

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.

3 participants