From 3093058e2230b452265a81773913b636bfd47338 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 16 Feb 2024 19:28:31 +0100 Subject: [PATCH] fix(CI/Build): Use alchemy bot PAT to checkout code This will make sure we trigger a workflow run after we pushed the changes. See https://github.com/orgs/community/discussions/26220#discussioncomment-3250854 --- .github/workflows/build.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54cb5718ce..56afef4600 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} + persist-credentials: false - name: Setup Node uses: actions/setup-node@v3 with: @@ -52,12 +53,16 @@ jobs: - name: Check git status id: git-status run: git diff --quiet || echo "changed=true" >> $GITHUB_OUTPUT - - name: git push + - name: git commit if: steps.git-status.outputs.changed == 'true' run: | git config --local user.name 'AlchemyCMS - CI Bot' git config --local user.email 'alchemy@blish.cloud' - git remote set-url origin https://x-access-token:${{ secrets.ALCHEMY_CI_BOT_ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY git add vendor/javascript git commit -m "Update JS packages" -m "Rebuilt packages due to updated dependencies." - git push origin HEAD:${{ github.event.pull_request.head.ref }} + - name: Push changes + if: steps.git-status.outputs.changed == 'true' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.ALCHEMY_CI_BOT_ACCESS_TOKEN }} + branch: ${{ github.ref }}