Skip to content

Commit b7d484f

Browse files
authored
ci: add post-merge workflow to trigger CI after auto-merge (#56)
Auto-merge via GITHUB_TOKEN does not trigger push-event workflows on main. This means ci.yml, security.yml, and scorecard.yml never ran after PR #54 and #55 merged, leaving the CI badge stale (showing an older failure). Add a post-merge workflow that fires on pull_request.closed (merged) and triggers all three workflows via workflow_dispatch on main. workflow_dispatch is exempt from the GITHUB_TOKEN event suppression, so these runs will fire reliably. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent 4b77c3b commit b7d484f

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/post-merge.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Post-merge CI trigger
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
permissions: {}
8+
9+
jobs:
10+
trigger:
11+
name: Trigger CI on main
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
if: github.event.pull_request.merged == true
15+
permissions:
16+
actions: write
17+
steps:
18+
- name: Trigger workflows on main
19+
env:
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
run: |
22+
gh workflow run ci.yml --ref main --repo "${{ github.repository }}"
23+
gh workflow run security.yml --ref main --repo "${{ github.repository }}"
24+
gh workflow run scorecard.yml --ref main --repo "${{ github.repository }}"

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ scripts/
7474
ci.yml CI: unit tests, build, integration tests (self-hosted)
7575
auto-approve.yml Auto-approve PRs from SebTardif and dependabot[bot]
7676
dependabot-auto-merge.yml Auto-merge minor/patch Dependabot PRs
77+
post-merge.yml Trigger CI/security/scorecard on main after auto-merge
7778
scorecard.yml OpenSSF Scorecard analysis (weekly + on push)
7879
security.yml Security: npm audit, Trivy fs scan, Gitleaks (weekly + on push/PR)
7980
```

0 commit comments

Comments
 (0)