From df86c93a04b075bb1af4486d72a551ed04a9ddb5 Mon Sep 17 00:00:00 2001 From: Pierre Jacquier Date: Wed, 5 Feb 2025 15:44:36 -0500 Subject: [PATCH] Restrict snapshot bot to non-main branches and to the snapshot dir (#5266) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Disable snapshot commit bot on main * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Restrict snapshot bot git add dir * Clean up sanps * Other git add . * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Clean up after bot (bad bot) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove -a from -am * Clean up --------- Co-authored-by: github-actions[bot] --- .github/workflows/e2e-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index f762cdbb8..071b9f7c9 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -161,11 +161,11 @@ jobs: continue-on-error: true run: rm -r test-results - name: check for changes - if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }} + if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 && github.ref != 'refs/heads/main' }} shell: bash id: git-check run: | - git add . + git add e2e/playwright/snapshot-tests.spec.ts-snapshots if git status | grep -q "Changes to be committed" then echo "modified=true" >> $GITHUB_OUTPUT else echo "modified=false" >> $GITHUB_OUTPUT @@ -174,14 +174,14 @@ jobs: if: steps.git-check.outputs.modified == 'true' shell: bash run: | - git add . + git add e2e/playwright/snapshot-tests.spec.ts-snapshots git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git git fetch origin echo ${{ github.head_ref }} git checkout ${{ github.head_ref }} - git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true + git commit -m "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true git push git push origin ${{ github.head_ref }} # only upload artifacts if there's actually changes