Skip to content

Conversation

@danielorbach
Copy link
Owner

Completes the Dependabot review workflow in the effort to close #4.

Neither pull_request nor pull_request_target triggers work reliably when Dependabot updates this workflow file:

The pragmatic solution: revert to pull_request and minimize the actions used in this file. By stripping down to just gh CLI commands (no checkout, no third-party actions beyond dependabot/fetch-metadata and anthropics/claude-code-action), Dependabot will rarely need to update this file—sidestepping the OIDC issue entirely.

When Dependabot does update this file, Claude jobs will fail, but the patch/minor auto-approve logic still runs since those jobs don't use Claude.

So I don't get lost in why each write permission is necessary.
There's no value in reading the CI status while reacting to Dependabot
PRs, as the interesting statuses are not updated until afterwards in
time because CI takes longer to complete.
This avoids the security concern of checking out untrusted PR code
while running with pull_request_target permissions, which grants
write access to the repository.
The pull_request_target trigger was intended to satisfy OIDC requirements
for Claude Code's GitHub app impersonation, but this approach does not
work with Dependabot PRs.

See anthropics/claude-code-action#713
The major job now runs for all ecosystems, not just github_actions.
GitHub Actions-specific guidance is preserved in a conditional section
within the prompt itself.
@danielorbach danielorbach self-assigned this Dec 2, 2025
@danielorbach danielorbach requested a review from Copilot December 2, 2025 23:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts from pull_request_target to pull_request trigger in the Dependabot workflow due to backend rejection issues with the Claude GitHub app. The change accepts that Claude jobs will fail when Dependabot updates the workflow file itself, but mitigates this by removing checkout steps and minimizing third-party actions, making such updates less frequent.

Key Changes:

  • Switched trigger from pull_request_target back to pull_request
  • Removed actions/checkout@v4 steps from Claude review jobs
  • Updated Claude prompts to use gh pr diff and gh pr view commands instead of relying on checked-out code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Prompts now clarify there is no local checkout available.

Minor reviews allow gh pr diff, view, and review (but not merge).
Major reviews restrict to comment-only with explicit disallow rules
for approval commands.
@danielorbach danielorbach merged commit 85f5316 into main Dec 2, 2025
13 checks passed
@danielorbach danielorbach deleted the bugfix/dependabot-pr-review branch December 2, 2025 23:55
danielorbach added a commit that referenced this pull request Dec 3, 2025
Replaces four separate jobs (metadata, patch, minor, major) with a
single "mergeview" job using conditional steps.

This addresses several issues with the multi-job approach:

- **Eliminated job output declarations** - No longer need to explicitly
pass metadata outputs between jobs via `needs.metadata.outputs.*`
- **Reduced workflow overhead** - Single job avoids queuing delays
between dependent jobs
- **Simplified conditional logic** - Step-level `if:` conditions are
easier to follow than job-level dependencies

All existing behavior is preserved: patch auto-approval, Claude reviews
for minor/major updates, and selective auto-merge.

Note: merging #29 into main worked but with minor glitches. This PR also
fixes them. See details in each commit.

## Test plan

- [ ] Verify patch update triggers auto-approve and auto-merge
- [ ] Verify minor update triggers Claude review then auto-merge
- [ ] Verify major update triggers Claude review without auto-merge
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.

Configuring Dependabot for dependency management

2 participants