Skip to content

Commit 1ec3bf7

Browse files
authored
fix: Update dist-pr.yml (#194)
Attempt to correct a previous miscalculation regarding the logic here. You must be on a branch for the CPR steps to work. This change does the following: - Adds fetch-depth so that the entire history gets fetched. - Get the SHA hash from the previous commit. - Create the PR from the dist branch. Now, the action compares the current dist branch (which has the new commit from release.yml) with main and creates a pull request.
1 parent 1ebf64c commit 1ec3bf7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.github/workflows/dist-pr.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@ jobs:
2828
with:
2929
ref: dist
3030
token: ${{ secrets.GH_MERGE_TOKEN }}
31+
fetch-depth: 0 # Fetch entire history
3132

32-
- name: Fetch Previous Commit
33-
run: |
34-
git fetch origin ${{ github.event.before }}:refs/remotes/origin/before_commit
35-
36-
- name: Checkout Previous Commit
37-
run: |
38-
git checkout refs/remotes/origin/before_commit
33+
- name: Get Previous Commit SHA
34+
id: get-previous-commit
35+
run: echo "previous_commit=$(git rev-parse HEAD^)" >> $GITHUB_OUTPUT
3936

4037
- name: Create Pull Request
4138
uses: peter-evans/create-pull-request@v5
@@ -50,3 +47,4 @@ jobs:
5047
automated pr
5148
dist-update
5249
draft: false # Or true, if you want to review before enabling auto-merge
50+
head: dist

0 commit comments

Comments
 (0)