From 46a278f4a09060bf50c1dbb404424db53dc70715 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 5 Nov 2024 23:15:41 +0900 Subject: [PATCH] PR: exiting if no changes are staged --- .github/workflows/pr_from_upstream.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_from_upstream.yml b/.github/workflows/pr_from_upstream.yml index 2e1cafb..a26104a 100644 --- a/.github/workflows/pr_from_upstream.yml +++ b/.github/workflows/pr_from_upstream.yml @@ -75,6 +75,12 @@ jobs: git commit -m "Merge changes from upstream ${{ env.UPSTREAM_REPO }}/${{ env.TARGET_BRANCH }} with conflicts" 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 - name: Push changes to new branch @@ -129,4 +135,4 @@ jobs: ```bash git push origin ${{ env.BRANCH_NAME }} ``` - base: ${{ env.TARGET_BRANCH }} \ No newline at end of file + base: ${{ env.TARGET_BRANCH }}