Skip to content

Commit

Permalink
Update pr-on-branch-push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ines-gimeno-molina authored May 1, 2024
1 parent 0c9318b commit aa7c45f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/pr-on-branch-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
create-pull-request:
if:
runs-on: ubuntu-latest
permissions:
issues: read
Expand All @@ -22,11 +23,13 @@ jobs:
- name: Check for branch changes
id: check_branch_changes
run: |
if git diff --quiet ${{ github.event.before }} ${{ github.sha }}; then
echo "No changes in the branch. Exiting workflow."
exit 0
fi
if: github.event_name == 'push' && github.ref_type == 'branch'
NEW_BRANCH_SHA=$(git rev-parse "${{ github.sha }}")
echo "This is the new branch sha: $NEW_BRANCH_SHA"
DEV_BRANCH_SHA=$(git rev-parse "refs/heads/dev")
echo "This is the new branch sha: $DEV_BRANCH_SHA"
if [[ "${NEW_BRANCH_SHA}" == "${DEV_BRANCH_SHA}" ]]; then
echo "No new commits in the branch. Exiting workflow."
exit 0
- name: Create PR
run: |
Expand Down

0 comments on commit aa7c45f

Please sign in to comment.