Repository navigation
ci: fix docs-preview PR comment failing without a checkout - #4155
Merged
Merged
Conversation
The docs-preview job downloads artifacts but has no `actions/checkout`, so `gh pr comment` aborted with "fatal: not a git repository" and the preview-URL comment was never posted (regression from scikit-hep#4075). Target the repo explicitly via a trusted `REPO: ${{ github.repository }}` env var and `--repo "${REPO}"`, mirroring the pr-type-label.yml idiom — no checkout or third-party action, so scikit-hep#4075's hardening is preserved. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ariostas
approved these changes
Jun 26, 2026
ariostas
left a comment
Member
There was a problem hiding this comment.
Thank you, @TaiSakuma!
(It still doesn't work on this PR because it has a workflow_run trigger, so it runs what is in main, but it should work after this is merged)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Docs-preview comments stopped appearing on PRs. The
docs-previewjob has noactions/checkout, so the finalgh pr commentstep aborts withfatal: not a git repository—ghinfers the repo from the git remote, which isn't there. Regression from #4075, which swapped thepeter-evans/create-or-update-commentaction (API token, no git) for theghCLI.The docs still deploy (
aws s3 syncruns before the failing step), so the preview URL is live — only the PR comment is missing. The step is gated on "no existing comment," so new PRs never get their first comment.Fix
Pass the repo explicitly, mirroring the
pr-type-label.ymlidiom:REPO: ${{ github.repository }}inenv:+--repo "${REPO}". Keeps #4075's hardening — no checkout, no third-party action, no new permissions, trusted value kept out of the inlinerun:.Verification
zizmorandcheck-github-workflowspass. Can't be validated on this PR (workflow_runuses the default-branch copy); takes effect after merge.🤖 Generated with Claude Code