From 3641c4fa634118705a6eb068e0de7201c8ce4f23 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Thu, 1 Feb 2024 15:51:00 -0800 Subject: [PATCH] wip: uses git to determine commit hash --- .github/workflows/deploy.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b17a4d7f4..8906e0404 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -113,30 +113,22 @@ jobs: id: sign run: | echo -n "${{ secrets.signing_key }}" | base64 --decode > /tmp/privkey - SIG=$(updater signing sign -k /tmp/privkey "${{ github.sha }}") + COMMIT=$(git rev-parse HEAD) + SIG=$(updater signing sign -k /tmp/privkey "$COMMIT") rm /tmp/privkey 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) 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 }}" + 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 }} - # - name: Commit and push - # uses: xxxxxxxxxxxxxxxxxxxxx@xx - # with: - # author_name: catalyst-cibot - # author_email: - # - name: Commit and push - # uses: EndBug/add-and-commit@v9 - # with: - # author_name: catalyst-cibot - # author_email: \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.token }} \ No newline at end of file