Repository navigation
Commit 562e16c
fix: run the app-ci path filter on pull requests only (#1)
dorny/paths-filter uses the GitHub API on a pull_request event, but on a
push it has to diff against github.event.before with git. That commit is
not in the changes job's default depth-1 checkout, so it fetches it — and
the checkout persists no credential (zizmor requires that), so on a
private repository the fetch dies with "could not read Username for
'https://github.com'". Every push to main after the first one therefore
failed the changes job, which skipped ci and commitlint: the merge gate
existed on pull requests only. The first push to a branch survived just
because github.event.before is the all-zero sha there.
Gate build-filters and the filter on github.event_name == 'pull_request'
and fall the job's roots output back to inputs.roots otherwise. The
filter is a pull-request time saver — most roots are untouched there —
while on the default branch every root should be verified anyway, so the
non-pull-request branch wants the full list regardless. Both branches
emit a JSON array string, so fromJSON and the ci job's != '[]' guard keep
working, no fetch-depth change is needed, and persist-credentials: false
stays.
Claude-Session: https://claude.ai/code/session_01J4HB8qJjdZwaAv42k6HMpv
Co-authored-by: iam-truongtrungnghia <nghia.truong@tpssoft.com>1 parent 3e2874f commit 562e16c
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
24 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
| |||
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
33 | | - | |
| 43 | + | |
| 44 | + | |
34 | 45 | | |
35 | 46 | | |
36 | 47 | | |
| |||
0 commit comments