Skip to content

Commit

Permalink
fix: fixes commit ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Feb 2, 2024
1 parent de04b80 commit b20e6c9
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ jobs:
token: ${{ secrets.token }}
- name: Create deployment branch
run: |
COMMIT=$(git rev-parse HEAD)
git checkout -b "auto-deploy-$COMMIT"
git checkout -b "auto-deploy-${{ github.sha }}"
- name: Update deployments
run: |
echo '${{ steps.discover.outputs.json }}' > /tmp/updates.json
Expand All @@ -110,6 +109,14 @@ jobs:
cue fmt --simplify $(git diff --name-only)
- name: Run diff
run: git --no-pager diff
- name: Commit changes
run: |
git config --global user.email "catalyst-cibot@projectcatalyst.io"
git config --global user.name "catalyst-cibot"
git add .
git commit -m "chore: auto-deploy from ${{ github.event.repository.name }}"
git push origin "auto-deploy-${{ github.sha }}"
- name: Sign commit hash
id: sign
run: |
Expand All @@ -118,21 +125,12 @@ jobs:
SIG=$(updater signing sign -k /tmp/privkey "$COMMIT")
rm /tmp/privkey
echo "GIT COMMIT: $COMMIT"
echo "signature=${SIG}" >> $GITHUB_OUTPUT
- name: Create PR
run: |
BODY="BEGIN-AUTO-DEPLOY-SIGNATURE:${{ steps.sign.outputs.signature }}:END-AUTO-DEPLOY-SIGNATURE"
COMMIT=$(git rev-parse HEAD)
echo "GIT COMMIT: $COMMIT"
echo "GITHUB COMMIT: ${{ github.sha }}"
git config --global user.email "catalyst-cibot@projectcatalyst.io"
git config --global user.name "catalyst-cibot"
git add .
git commit -m "chore: auto-deploy from ${{ github.event.repository.name }}"
git push origin "auto-deploy-$COMMIT"
gh pr create --title "chore: auto-deploy from ${{ github.event.repository.name }}" --body "$BODY"
env:
GITHUB_TOKEN: ${{ secrets.token }}

0 comments on commit b20e6c9

Please sign in to comment.