Skip to content

Commit 1ebf64c

Browse files
authored
fix: Update dist-pr.yml (#193)
Changes the way the workflow checks things out. - Adds step to fetch previous commit. - Changes checkout previous commit to check out the commit using the new local ref that we just created. Gemini explains it like this (so much collaboration): Why This Should Work Explicit Fetch: We're explicitly fetching the exact commit we need, bypassing any potential issues with fetch-depth calculations. Local Ref: We're creating a local ref, making the checkout unambiguous. Branch Context: We start by checking out the branch, then we check out a specific commit.
1 parent 6bdb1e3 commit 1ebf64c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/dist-pr.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ jobs:
2828
with:
2929
ref: dist
3030
token: ${{ secrets.GH_MERGE_TOKEN }}
31-
fetch-depth: 2
31+
32+
- name: Fetch Previous Commit
33+
run: |
34+
git fetch origin ${{ github.event.before }}:refs/remotes/origin/before_commit
3235
3336
- name: Checkout Previous Commit
34-
run: git checkout ${{ github.event.before }}
37+
run: |
38+
git checkout refs/remotes/origin/before_commit
3539
3640
- name: Create Pull Request
3741
uses: peter-evans/create-pull-request@v5

0 commit comments

Comments
 (0)