From e9c3d953f2986b73619bb1c41340a05ac5594746 Mon Sep 17 00:00:00 2001 From: Solon Date: Mon, 30 Sep 2024 14:28:48 +0100 Subject: [PATCH] Adds check for if there are changes to make the PR --- .github/workflows/update-flux.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/update-flux.yaml b/.github/workflows/update-flux.yaml index e686209f..5bc86d4d 100644 --- a/.github/workflows/update-flux.yaml +++ b/.github/workflows/update-flux.yaml @@ -30,10 +30,22 @@ jobs: git push --set-upstream origin gh-actions/flux-update else echo "No changes to commit." + echo "no changes" > /tmp/no-changes.txt + fi + shell: bash + + - name: Check for changes + id: changes + run: | + if [ -f /tmp/no-changes.txt ]; then + echo "::set-output name=changes::false" + else + echo "::set-output name=changes::true" fi shell: bash - name: Create Pull Request + if: steps.changes.outputs.changes == 'true' run: gh pr create -B master -H gh-actions/flux-update --title 'Update Flux' --body 'Updates flux components using Flux CLI' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}