Repository navigation
Enable Dependabot auto-merge with a GitHub App token - #90
maks-rafalko wants to merge 1 commit into
Conversation
PRs queued by GITHUB_TOKEN never get a merge_group CI run, so the merge queue removes them with "no response for status checks". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
theofidry
left a comment
There was a problem hiding this comment.
@maks-rafalko maybe it would be better to generate a dedicated token with restricted permissions and configure the latter as an environment variable? Or a dedicated App (for which the token can be more short-lived)?
This also means double checking the cooldowns + max age time of all updated deps as otherwise this workflows means:
- one can merge a malicious package
- can have code from the malicious package minting tokens (and here you generate a token with a certain level of permissions)
I'm not well versed enough to fully measure the risk or capabilities but it does sound quite risky.
I am yet to discover the best option for merge queue, but it looks like there are 2 official recommendations: to use the GH app or a personal token (PAT), which expires. I think it will be the app with limited access to this repo only, but I didn't analyse it yet (it's draft).
cool down is ok. I just want to say that I still review all the PRs even if they are merged. And nothing is being deployed automatically here. So the risk is practically ~0. What I want to achieve is to automate the boring staff, not removing the human review. |
Depends what they get access from by minting the token + if someone's machine gets corrupted form having it locally.
I sympathise with the goal, I just wanted to point out potential risks – especially given the last year and last October in particular, crazy rate of security issues and malware and account takeovers. |
Dependabot PRs keep getting removed from the merge queue with no response for status checks (e.g. #89, and the first two attempts on #88).
The cause is that auto-merge is enabled with
GITHUB_TOKEN, so the merge queue entry is created bygithub-actions. GitHub does not start workflow runs for events caused byGITHUB_TOKEN, so nomerge_grouprun of CI starts and the required checks never report. When #88 was queued manually, CI ran and it merged within a minute.This switches the job to a GitHub App installation token (
actions/create-github-app-token), whose events do trigger workflows.Required before merging: a GitHub App installed on this repo with Contents: write and Pull requests: write, and its ID and private key added as Dependabot secrets
AUTOMERGE_APP_IDandAUTOMERGE_APP_PRIVATE_KEY. Dependabot-triggered runs can't read Actions secrets.