PR: exiting if no changes are staged

This commit is contained in:
XargonWan 2024-11-05 23:15:41 +09:00
parent d17fa582a8
commit 46a278f4a0

View file

@ -75,6 +75,12 @@ jobs:
git commit -m "Merge changes from upstream ${{ env.UPSTREAM_REPO }}/${{ env.TARGET_BRANCH }} with conflicts" git commit -m "Merge changes from upstream ${{ env.UPSTREAM_REPO }}/${{ env.TARGET_BRANCH }} with conflicts"
fi fi
# Check if any changes were introduced by the merge
if git diff --exit-code; then
echo "No changes detected after merging. Exiting."
exit 0 # Exit the workflow if no changes are detected
fi
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
- name: Push changes to new branch - name: Push changes to new branch
@ -129,4 +135,4 @@ jobs:
```bash ```bash
git push origin ${{ env.BRANCH_NAME }} git push origin ${{ env.BRANCH_NAME }}
``` ```
base: ${{ env.TARGET_BRANCH }} base: ${{ env.TARGET_BRANCH }}