Skip to content

Commit

Permalink
Only push when there is a diff
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardGomezEscandell committed Sep 12, 2023
1 parent 26f7e99 commit f9a8de4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/auto-updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit f9a8de4

Please sign in to comment.