Skip to content

Commit

Permalink
💚 misc(deps): check for existing branch upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Nov 29, 2024
1 parent 4834a9e commit 29bbd2e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/upgrade-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ jobs:
git config --global user.name "welpo"
git config --global user.email "[email protected]"
- name: Check for existing branch
id: check_branch
run: |
if git ls-remote --heads origin deps/upgrade-${{ matrix.dependency }} | grep -q deps/upgrade-${{ matrix.dependency }}; then
echo "branch_exists=true" >> $GITHUB_OUTPUT
else
echo "branch_exists=false" >> $GITHUB_OUTPUT
fi
- name: Handle existing branch
if: steps.check_branch.outputs.branch_exists == 'true'
run: |
echo "Branch deps/upgrade-${{ matrix.dependency }} already exists."
echo "Skipping upgrade as there's already an open PR"
exit 0
- name: Create and switch to new branch
run: |
git checkout -b deps/upgrade-${{ matrix.dependency }}
Expand Down

0 comments on commit 29bbd2e

Please sign in to comment.