From f9a8de4cf7aa453f53dac15bce0008a4e517437f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 12 Sep 2023 10:53:13 +0200 Subject: [PATCH] Only push when there is a diff --- .github/workflows/auto-updates.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/auto-updates.yaml b/.github/workflows/auto-updates.yaml index 1278c5301..b9ac0d05d 100644 --- a/.github/workflows/auto-updates.yaml +++ b/.github/workflows/auto-updates.yaml @@ -137,8 +137,19 @@ jobs: uses: ./.github/actions/update-workspace-dependencies with: module: wsl-pro-service + - name: Detect modifications + shell: bash + id: check-diff + run: | + hasModif="false" + MODIFIED=$(git status --porcelain --untracked-files=no) + if [ -n "$MODIFIED" ]; then + hasModif="true" + fi + echo "modified=${hasModif}" >> $GITHUB_OUTPUT - name: Create Pull Request uses: peter-evans/create-pull-request@v5 + if: steps.check-diff.outputs.modified == 'true' with: commit-message: Auto update internal dependencies title: Auto update WSL-Pro-Service dependencies @@ -147,5 +158,6 @@ jobs: branch: auto-updates/update-internal-dependencies token: ${{ secrets.GITHUB_TOKEN }} - name: Push branch + if: steps.check-diff.outputs.modified == 'true' run: | git push origin auto-updates/update-internal-dependencies:main