From 87fa207c740ba917ea643c6157a79b6cec4805a0 Mon Sep 17 00:00:00 2001 From: Aditya Maru Date: Fri, 4 Oct 2024 11:19:32 -0700 Subject: [PATCH] tweak cache workflow --- .github/workflows/bump-cache-version.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-cache-version.yml b/.github/workflows/bump-cache-version.yml index 9f48dda..5030d2a 100644 --- a/.github/workflows/bump-cache-version.yml +++ b/.github/workflows/bump-cache-version.yml @@ -24,7 +24,13 @@ jobs: - name: Build run: npm run build + - name: Check for changes + id: git-check + run: | + git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT + - name: Create Pull Request + if: steps.git-check.outputs.changes == 'true' uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -35,4 +41,15 @@ jobs: Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action branch: bump-cache-version - base: main \ No newline at end of file + base: main + delete-branch: true + + - name: Check PR creation + if: steps.git-check.outputs.changes == 'true' + run: | + echo "Pull request created successfully" + + - name: No changes detected + if: steps.git-check.outputs.changes != 'true' + run: | + echo "No changes detected. Skipping PR creation."