77
88env :
99 REPO_PATH : ${{ github.repository }}
10- GIT_REF : ${{ github.event.pull_request.head.sha }}
1110
1211jobs :
1312 # Job 1: Create version bump PR when changesets are merged to main
2625 uses : actions/checkout@v4
2726 with :
2827 fetch-depth : 0
29- ref : ${{ env.GIT_REF }}
28+ ref : ${{ github.event.pull_request.head.sha }}
3029
3130 - name : Setup Node.js
3231 uses : actions/setup-node@v4
5857 GITHUB_TOKEN : ${{ secrets.CROSS_REPO_ACCESS_TOKEN }}
5958
6059 # Job 2: Process version bump PR created by R00-B0T
61- changeset-pr-approve-merge :
60+ changeset-pr-edit-approve :
6261 name : Auto approve and merge Bump version PRs
6362 runs-on : ubuntu-latest
6463 permissions :
@@ -70,12 +69,28 @@ jobs:
7069 github.actor == 'R00-B0T' &&
7170 contains(github.event.pull_request.title, 'Changeset version bump')
7271 steps :
72+ - name : Determine checkout ref
73+ id : checkout-ref
74+ run : |
75+ echo "Event action: ${{ github.event.action }}"
76+ echo "Actor: ${{ github.actor }}"
77+ echo "Head ref: ${{ github.head_ref }}"
78+ echo "PR SHA: ${{ github.event.pull_request.head.sha }}"
79+
80+ if [[ "${{ github.event.action }}" == "opened" && "${{ github.actor }}" == "R00-B0T" ]]; then
81+ echo "Using branch ref: ${{ github.head_ref }}"
82+ echo "git_ref=${{ github.head_ref }}" >> $GITHUB_OUTPUT
83+ else
84+ echo "Using SHA ref: ${{ github.event.pull_request.head.sha }}"
85+ echo "git_ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
86+ fi
87+
7388 - name : Checkout Repo
7489 uses : actions/checkout@v4
7590 with :
7691 token : ${{ secrets.CROSS_REPO_ACCESS_TOKEN }}
7792 fetch-depth : 0
78- ref : ${{ env.GIT_REF }}
93+ ref : ${{ steps.checkout-ref.outputs.git_ref }}
7994
8095 # Get current and previous versions to edit changelog entry
8196 - name : Get version
@@ -102,10 +117,10 @@ jobs:
102117 run : |
103118 git config user.name "R00-B0T"
104119 git config user.email [email protected] 105- git status
106120 echo "Running git add and commit..."
107121 git add CHANGELOG.md
108122 git commit -m "Updating CHANGELOG.md format"
123+ git status
109124 echo "--------------------------------------------------------------------------------"
110125 echo "Pushing to remote..."
111126 echo "--------------------------------------------------------------------------------"
0 commit comments