Skip to content

Commit 5a269ef

Browse files
authored
Merge pull request #30 from comet-ml/CRThaze/fix-preview-readme-skip-fork-prs
ci(preview-readme): skip fork PRs to fix checkout failure
2 parents 1e3d2d5 + 8333bb6 commit 5a269ef

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/preview-readme.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010

1111
jobs:
1212
preview-readme:
13+
# This job checks out the head branch by name and posts the rendered README
14+
# diff back as a PR comment. Both of those require the head branch to live in
15+
# this repo and a write-scoped GITHUB_TOKEN. Neither holds for fork PRs: the
16+
# branch exists only in the fork (so `actions/checkout` with a bare `ref:`
17+
# fetches refs/heads/<branch> from this repo and fails), and the
18+
# pull_request event grants forks a read-only token (so createComment 403s).
19+
# Skip forks; internal branches still get the preview.
20+
if: github.event.pull_request.head.repo.full_name == github.repository
1321
runs-on: ubuntu-latest
1422
timeout-minutes: 5
1523
steps:

0 commit comments

Comments
 (0)