Skip to content

Commit 1f84187

Browse files
committed
chore: adapted action to explicitly fetch main
1 parent 9b964d7 commit 1f84187

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/changesets-release-pr.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,16 @@ jobs:
3333
- name: 🔄 Init Node & NPM cache
3434
uses: ./.github/actions/npm-cache
3535

36-
- name: 🔁 Fetch base branch (main)
36+
- name: 🔁 Ensure full history & fetch base (main)
37+
shell: bash
3738
run: |
38-
git remote set-url origin "https://github.com/${{ github.repository }}.git"
39-
git fetch --no-tags --prune --depth=0 origin +refs/heads/main:refs/remotes/origin/main
39+
set -euo pipefail
40+
# Falls Repo shallow ist, erst „unshallow“
41+
if git rev-parse --is-shallow-repository >/dev/null 2>&1 && git rev-parse --is-shallow-repository; then
42+
git fetch --unshallow --no-tags --prune
43+
fi
44+
# Base-Ref explizit holen (ohne --depth=0!)
45+
git fetch --no-tags --prune origin +refs/heads/main:refs/remotes/origin/main
4046
git branch -a
4147
git rev-parse HEAD
4248
git rev-parse remotes/origin/main
@@ -46,7 +52,6 @@ jobs:
4652
shell: bash
4753
run: |
4854
set -euo pipefail
49-
# explizit gegen die Remote-Base vergleichen:
5055
npx changeset status --since=origin/main --verbose > .changeset-status.txt || {
5156
echo "⚠️ changeset status failed; falling back to listing existing changesets"
5257
ls -1 .changeset/*.md 2>/dev/null || true

0 commit comments

Comments
 (0)