Skip to content

Commit e3fcf55

Browse files
committed
ci: run workflow on pull requests
- Add pull_request trigger for PRs targeting main - Use base.sha for PR change detection (vs github.event.before for push)
1 parent 986bba6 commit e3fcf55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/commit.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- "**"
77

8+
pull_request:
9+
branches:
10+
- main
11+
812
# Allow manual trigger
913
workflow_dispatch:
1014

@@ -47,7 +51,8 @@ jobs:
4751
id: affected
4852
uses: loadingalias/cargo-rail-action@88618d12427cee84efbe1ef556dd9f8445acad95 # v1.0.2
4953
with:
50-
since: ${{ github.event.before }}
54+
# For push: compare against previous commit; for PR: compare against base branch
55+
since: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
5156

5257
# ==========================================================================
5358
# Job 2: CI (skipped if docs-only)

0 commit comments

Comments
 (0)