Skip to content

Dependabot auto-merged commits get no CI run on main: GITHUB_TOKEN pushes don't trigger workflows #584

Closed

Description

@scttfrdmn

Problem

A commit that Dependabot auto-merges onto main gets no CI run on main: no ci.yml and no Security Scan.

dependabot-automerge.yml runs gh pr merge --auto --squash with GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}. When auto-merge fires, GitHub records the push as made by that token, and GitHub does not create workflow runs for events triggered by GITHUB_TOKEN. This is a deliberate guard against recursive runs. The push to main happens, and nothing runs on it.

Evidence

Every recent merge to main, with whether it got a push run:

Merge commit PR Merged by ci.yml run on main
3f9ceb54 #560 scttfrdmn ✅ success
88399484 #553 scttfrdmn ✅ success
— #555 app/github-actions ❌ none
— #564 app/github-actions ❌ none
37d40879 #583 scttfrdmn ✅ success
14216b71 #577 app/github-actions ❌ none
670b5f75 #582 app/github-actions ❌ none

Checked with gh run list --workflow=ci.yml --commit=<full sha>, which returns an empty list for every app/github-actions merge.

What it costs, stated honestly

Less than it sounds like, but not nothing.

  • The merged code was tested. Strict branch protection requires a PR to be up to date before it can merge. So the squash commit has the same tree the PR's last green run tested, and the code on main is the code CI checked.
  • No job runs only on main. Nothing in .github/workflows/ gates on event_name == 'push' or refs/heads/main, so no main-only job is being skipped.
  • What is lost is confirmation of main itself. The workflows' status on main shows only the last human merge, so a Dependabot run of merges reads as green without anything having run on main. Security Scan's push run on main is skipped too.
  • The gap grows as auto-merge does its job. Four of the last seven merges were made by the app. Auto-merge was only recently made to work at all (the five causes in the workflow's header), so this is new rather than long-standing.

This milestone's theme is suites that never run. This is a suite that never runs on one class of commit, and it reads as green.

Fix

Have the merge use a token whose pushes trigger workflows:

  1. A GitHub App installation token (recommended). actions/create-github-app-token mints one per run, it is scoped to this repository, it expires within an hour, and it needs no human account. Pushes made with it trigger push workflows normally.
  2. A fine-grained PAT with contents: write and pull-requests: write on this repo only. Simpler, but tied to a person and needs rotating.

Either one needs a new repository secret, which is a settings change for the maintainer. That is why this is an issue and not a PR.

Not a fix: making a workflow re-trigger CI on workflow_run after Dependabot merges. Its checks report against the triggering workflow's context, and it adds a second path to keep in sync with push.

Acceptance

  • The next Dependabot auto-merge produces a ci.yml push run and a Security Scan run on its merge commit. Verify with gh run list --workflow=ci.yml --commit=<sha> returning a run. A green status on main alone does not count, because that is what is green today.
  • A comment in dependabot-automerge.yml records why the token is not GITHUB_TOKEN, so nobody "simplifies" it back. This would be cause 6 in its header list.
  • Optionally, a test in internal/config that fails if the merge step's token is secrets.GITHUB_TOKEN. This is the same shape as the other workflow-invariant tests there.

Activity

  1. added
    type: ci-cd
    priority: medium
    area: ci-cd
    on Oct 6, 2026
  2. scttfrdmn commented on Oct 6, 2026

    @scttfrdmn
    OwnerAuthor

    Reopening: #585's "Fixes #584" closed this on merge, but the acceptance criterion hasn't been met yet. No Dependabot PR has auto-merged since #585 (8fd6cb90), so nothing has shown that a merge made with AUTOMERGE_TOKEN gets a ci.yml push run. Close this when gh run list --workflow=ci.yml --commit=<sha> returns a push run for the first such merge commit.

  3. scttfrdmn commented on Oct 7, 2026

    @scttfrdmn
    OwnerAuthor

    Verified on a real Dependabot auto-merge. Closing.

    #592 (source-map-js 1.2.1 → 1.2.2, the security update for alert #20) is the first Dependabot merge since #585 switched the merge step to AUTOMERGE_TOKEN:

    The acceptance criterion was gh run list --workflow=ci.yml --commit=<sha> returning a push run for an auto-merged commit. It does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ci-cdpriority: mediumtype: ci-cd

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions