Commit 8333bb6
committed
ci(preview-readme): skip fork PRs to fix checkout failure
The preview-readme job checks out the head branch by name
(ref: github.event.pull_request.head.ref) without setting repository, so
actions/checkout fetches refs/heads/<branch> from this repo. For a fork PR
the branch lives only in the fork, so the fetch finds no ref and the step
fails with 'git failed with exit code 1' (seen on PR #28, from
gaul/s3proxy-chart). Every other workflow uses the default merge-ref
checkout and is unaffected.
Even with checkout fixed, the comment-posting steps need a write-scoped
GITHUB_TOKEN, which the pull_request event does not grant fork PRs, so the
preview feature is inherently limited to same-repo branches.
Guard the job on head.repo.full_name == github.repository: internal
branches still get the README preview; fork PRs skip it cleanly instead of
reporting a spurious failure.1 parent 1e3d2d5 commit 8333bb6
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
| |||
0 commit comments