From f620331a7476cf17ec2b45420cdf465fb7ad236f Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Thu, 1 Feb 2024 14:38:10 -0800 Subject: [PATCH] wip: attempts PR --- .github/workflows/deploy.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f6d14e7a9..98c18c8ec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -96,6 +96,9 @@ jobs: with: repository: ${{ inputs.deployment_repo }} token: ${{ secrets.token }} + - name: Create deployment branch + run: | + git checkout -b "auto-deploy-${{ github.sha }}" - name: Update deployments run: | echo '${{ steps.discover.outputs.json }}' > /tmp/updates.json @@ -107,10 +110,28 @@ jobs: - name: Run diff run: git --no-pager diff - name: Sign commit hash + id: sign run: | echo -n "${{ secrets.signing_key }}" | base64 --decode > /tmp/privkey - updater signing sign -k /tmp/privkey "${{ github.sha }}" + SIG=$(updater signing sign -k /tmp/privkey "${{ github.sha }}") 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" + + git add . + git commit -m "chore: auto-deploy from ${{ github.event.repository.name }}" + git push origin "auto-deploy-${{ github.sha }}" + 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: