Skip to content

fix: use explicit secrets and write permissions in dependabot-rebase workflow - #148

Merged
don-petry merged 3 commits into
mainfrom
fix/dependabot-rebase-workflow-secrets
May 4, 2026
Merged

don-petry merged 3 commits into
mainfrom
fix/dependabot-rebase-workflow-secrets

Conversation

@don-petry

Copy link
Copy Markdown
Contributor

Summary

  • Replaces secrets: inherit with explicit APP_ID/APP_PRIVATE_KEY secrets
  • Upgrades job permissions from read to write (required for branch updates and PR approvals)
  • Adds workflow_dispatch trigger so the queue can be flushed manually

Root cause

secrets: inherit on a reusable workflow called with permissions: read causes a startup_failure — the reusable needs contents: write and pull-requests: write to update branches and approve PRs. GitHub only grants the calling job's permission level to the reusable, so read-only permissions silently prevent all API calls.

Test plan

  • Workflow should pass CI
  • After merge, manually trigger the workflow via Actions → Dependabot update and merge → Run workflow to verify no startup failure

…workflow

secrets: inherit + permissions: read causes startup_failure on reusable
workflows. Use explicit APP_ID/APP_PRIVATE_KEY secrets and write permissions
so the reusable workflow can update branches and approve PRs.
Copilot AI review requested due to automatic review settings May 4, 2026 12:01
@coderabbitai

coderabbitai Bot commented May 4, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 15 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 588511ea-048f-42d7-8b9a-8e850ea39f6e

📥 Commits

Reviewing files that changed from the base of the PR and between 681b417 and 4599a99.

📒 Files selected for processing (1)
  • .github/workflows/dependabot-rebase.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dependabot-rebase-workflow-secrets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 22 minutes and 15 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the Dependabot rebase caller workflow to avoid reusable-workflow startup failures by explicitly passing required secrets, broadening job permissions for branch updates/approvals, and enabling manual runs.

Changes:

  • Replace secrets: inherit with explicit APP_ID / APP_PRIVATE_KEY secret passing
  • Upgrade job permissions to contents: write and pull-requests: write
  • Add workflow_dispatch trigger for manual queue flushing

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

Comment thread .github/workflows/dependabot-rebase.yml Outdated
Comment on lines +11 to +15
# • You MUST NOT change: trigger event, the concurrency group name,
# the `uses:` line, `secrets: inherit`, or the job-level `permissions:`
# block — reusable workflows can be granted no more permissions than the
# calling job has, so removing the stanza breaks the reusable's gh API
# calls.
# the explicit secrets block, or the job-level `permissions:` block —
# reusable workflows can be granted no more permissions than the calling
# job has, so removing the stanza breaks
# the reusable's gh API calls.
push:
branches:
- main
workflow_dispatch: # allow manual trigger to flush Dependabot PR queue
Comment thread .github/workflows/dependabot-rebase.yml Outdated
Comment on lines +9 to +10
# • You MAY change: the SHA in the `uses:` line when upgrading the reusable
# workflow version (bump SHA to latest main of petry-projects/.github).
Comment thread .github/workflows/dependabot-rebase.yml Outdated
pull-requests: read
contents: write # update-branch via GITHUB_TOKEN (may touch .github/workflows/)
pull-requests: write # re-approve PRs after branch update
uses: petry-projects/.github/.github/workflows/dependabot-rebase-reusable.yml@v1
don-petry added 2 commits May 4, 2026 07:22
Address Copilot review comments:
- Pin uses: to commit SHA instead of mutable @v1 tag
- Update header: 'SHA' → 'ref', remove ban on workflow_dispatch trigger
- Update header: '(inherited)' → '(passed explicitly)' for secrets
@sonarqubecloud

sonarqubecloud Bot commented May 4, 2026

Copy link
Copy Markdown

@don-petry
don-petry merged commit 6cab631 into main May 4, 2026
20 checks passed
@don-petry
don-petry deleted the fix/dependabot-rebase-workflow-secrets branch May 4, 2026 12:26
don-petry added a commit that referenced this pull request Jun 19, 2026
…workflow (#148)

* fix: use explicit secrets and write permissions in dependabot-rebase workflow

secrets: inherit + permissions: read causes startup_failure on reusable
workflows. Use explicit APP_ID/APP_PRIVATE_KEY secrets and write permissions
so the reusable workflow can update branches and approve PRs.

* fix: pin reusable SHA, update header guidance, fix secrets comment

Address Copilot review comments:
- Pin uses: to commit SHA instead of mutable @v1 tag
- Update header: 'SHA' → 'ref', remove ban on workflow_dispatch trigger
- Update header: '(inherited)' → '(passed explicitly)' for secrets

* fix: apply prettier formatting (single space before inline comments)
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