Skip to content

Commit

Permalink
ci(update-deps): create PR only if there are pending changes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjavi committed Aug 9, 2023
1 parent 8a9cef8 commit 49af2ea
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/update-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ jobs:
- name: 'Check code quality'
uses: ./.github/actions/check-quality

- name: 'Prepare git'
- name: Compare Changes
id: compare_changes
run: |
git config --global user.email "noreply@github.com"
git config --global user.name "Github Actions"
git branch -u origin/main main
changes=$(git diff --name-only HEAD~1)
echo "pending_git_changes=${changes}" >> "$GITHUB_OUTPUT"
createPullRequest:
name: 'Update dependencies'
runs-on: ubuntu-latest
needs: [updateDependencies]
if: ${{ needs.updateDependencies.outputs.pending_git_changes != '' }}
steps:
- name: Install jq
run: |
sudo apt-get update
Expand Down

0 comments on commit 49af2ea

Please sign in to comment.