Polish open source project hygiene#38
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a74af95f54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| set -euo pipefail | ||
| if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
| git fetch --no-tags --depth=1 origin "${{ github.base_ref }}" | ||
| git diff --check "origin/${{ github.base_ref }}...HEAD" |
There was a problem hiding this comment.
Fetch enough history before diffing PRs
In the pull_request path, this diff usually runs after actions/checkout has checked out the synthetic PR merge commit with its default shallow history (fetch-depth: 1). Fetching only the base branch tip at depth 1 leaves both commits grafted, so git diff origin/${{ github.base_ref }}...HEAD cannot find a merge base and exits with fatal: ... no merge base, failing CI for normal PRs before tests run. I reproduced the same sequence with a shallow checkout of a PR merge ref plus git fetch --depth=1 origin main; use a non-shallow checkout/fetch or diff against the appropriate event SHAs instead.
Useful? React with 👍 / 👎.
a74af95 to
b9dc46f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9dc46f836
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| run: | | ||
| set -euo pipefail | ||
| if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
| git fetch --no-tags --depth=1 origin "${{ github.base_ref }}" |
There was a problem hiding this comment.
Avoid re-shallowing the base before diffing
In pull_request runs this fetch still uses --depth=1; even with the new checkout fetch-depth: 0, running a full clone followed by this exact fetch creates .git/shallow at the base tip, so git diff origin/${{ github.base_ref }}...HEAD can again fail with no merge base for a PR merge commit. Fresh evidence after the new change is that the later fetch is what reintroduces the shallow boundary; git fetch -h also distinguishes --depth <depth> from --unshallow, so the safer fix is to avoid the shallow fetch here or explicitly unshallow/fetch enough history before the three-dot diff.
Useful? React with 👍 / 👎.
Summary
Tests