Understand the motivation for post-merge CI reruns
Intent: Explain why a repository benefits from re-running CI after a merge to master, even when PR checks have already passed.
Affected files: .github/workflows/
Evidence
Branch name: github-actions-ci-rerun, Title: Trigger post-merge CI rerun
When multiple PRs merge in quick succession, the integrated result on master may differ from what each PR validated individually. A post-merge CI rerun ensures:
- Integration correctness — Tests run against the true merged state, catching conflicts between concurrent PRs.
- Deployment confidence — If CD pipelines trigger from
master, a green post-merge run confirms the deployable artifact is sound.
- Fast feedback — Contributors are notified promptly if their merge broke the trunk.
This branch adds or modifies GitHub Actions workflow files to trigger such reruns automatically.
Configure the workflow trigger
Intent: Set up a GitHub Actions workflow that fires on push events to the master branch, effectively acting as a post-merge CI gate.
Affected files: .github/workflows/
Evidence
on: push: branches: [master]
The core mechanism is a push event scoped to the master branch. Every time a PR is merged (which results in a push to master), GitHub fires this event and the workflow runs:
on:
push:
branches:
- master
This is distinct from pull_request triggers, which validate the PR head commit, not the post-merge commit on the target branch.
Reuse existing CI jobs for the rerun
Intent: Avoid duplicating test/build definitions by referencing the same job configuration used in PR checks.
Affected files: .github/workflows/
Evidence
jobs: rerun uses or references existing test matrix
Best practice is to keep CI job definitions DRY. The post-merge workflow likely either:
- Calls a reusable workflow via
uses: ./.github/workflows/ci.yml
- Shares the same job matrix to run the identical suite of tests, lints, and builds
This guarantees that the post-merge validation is equivalent to what was checked during the PR phase, with no configuration drift.