Skip to content

ci: fix docs-preview PR comment failing without a checkout - #4155

Merged
ariostas merged 1 commit into
scikit-hep:mainfrom
TaiSakuma:fix-docs-preview-comment
Jun 26, 2026
Merged

ariostas merged 1 commit into
scikit-hep:mainfrom
TaiSakuma:fix-docs-preview-comment

Conversation

@TaiSakuma

Copy link
Copy Markdown
Member

Problem

Docs-preview comments stopped appearing on PRs. The docs-preview job has no actions/checkout, so the final gh pr comment step aborts with fatal: not a git repository — gh infers the repo from the git remote, which isn't there. Regression from #4075, which swapped the peter-evans/create-or-update-comment action (API token, no git) for the gh CLI.

The docs still deploy (aws s3 sync runs 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.yml idiom: REPO: ${{ github.repository }} in env: + --repo "${REPO}". Keeps #4075's hardening — no checkout, no third-party action, no new permissions, trusted value kept out of the inline run:.

Verification

zizmor and check-github-workflows pass. Can't be validated on this PR (workflow_run uses the default-branch copy); takes effect after merge.

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added the type/ci PR title type: ci (set automatically) label Jun 26, 2026
@TaiSakuma
TaiSakuma requested a review from ariostas June 26, 2026 17:54
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.43%. Comparing base (e583001) to head (899b4a4).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files

see 3 files with indirect coverage changes

@ariostas ariostas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@ariostas
ariostas merged commit 4fa3195 into scikit-hep:main Jun 26, 2026
18 checks passed
@TaiSakuma
TaiSakuma deleted the fix-docs-preview-comment branch July 21, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/ci PR title type: ci (set automatically)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants