Skip to content

Commit b20e6c9

Browse files
committed
fix: fixes commit ordering
1 parent de04b80 commit b20e6c9

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

.github/workflows/deploy.yml

+11-13
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ jobs:
9898
token: ${{ secrets.token }}
9999
- name: Create deployment branch
100100
run: |
101-
COMMIT=$(git rev-parse HEAD)
102-
git checkout -b "auto-deploy-$COMMIT"
101+
git checkout -b "auto-deploy-${{ github.sha }}"
103102
- name: Update deployments
104103
run: |
105104
echo '${{ steps.discover.outputs.json }}' > /tmp/updates.json
@@ -110,6 +109,14 @@ jobs:
110109
cue fmt --simplify $(git diff --name-only)
111110
- name: Run diff
112111
run: git --no-pager diff
112+
- name: Commit changes
113+
run: |
114+
git config --global user.email "[email protected]"
115+
git config --global user.name "catalyst-cibot"
116+
117+
git add .
118+
git commit -m "chore: auto-deploy from ${{ github.event.repository.name }}"
119+
git push origin "auto-deploy-${{ github.sha }}"
113120
- name: Sign commit hash
114121
id: sign
115122
run: |
@@ -118,21 +125,12 @@ jobs:
118125
SIG=$(updater signing sign -k /tmp/privkey "$COMMIT")
119126
rm /tmp/privkey
120127
128+
echo "GIT COMMIT: $COMMIT"
129+
121130
echo "signature=${SIG}" >> $GITHUB_OUTPUT
122131
- name: Create PR
123132
run: |
124133
BODY="BEGIN-AUTO-DEPLOY-SIGNATURE:${{ steps.sign.outputs.signature }}:END-AUTO-DEPLOY-SIGNATURE"
125-
COMMIT=$(git rev-parse HEAD)
126-
127-
echo "GIT COMMIT: $COMMIT"
128-
echo "GITHUB COMMIT: ${{ github.sha }}"
129-
130-
git config --global user.email "[email protected]"
131-
git config --global user.name "catalyst-cibot"
132-
133-
git add .
134-
git commit -m "chore: auto-deploy from ${{ github.event.repository.name }}"
135-
git push origin "auto-deploy-$COMMIT"
136134
gh pr create --title "chore: auto-deploy from ${{ github.event.repository.name }}" --body "$BODY"
137135
env:
138136
GITHUB_TOKEN: ${{ secrets.token }}

0 commit comments

Comments
 (0)