File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 5353 env :
5454 GITHUB_TOKEN : ${{ secrets.PAT_SERVICE_ACCOUNT }}
5555 run : |
56+ # Fetch dev branch to compare
57+ git fetch origin dev
58+
59+ # Check if there are differences between master and dev
60+ git diff --quiet master origin/dev
61+ if [ $? -eq 0 ]; then
62+ echo "No differences found between master and dev. Skipping PR creation."
63+ echo "SKIP_PR=true" >> $GITHUB_ENV
64+ exit 0
65+ fi
66+
5667 # Create branch for PR
5768 git checkout -b update-dev-from-master
5869 git push origin update-dev-from-master --force
@@ -66,13 +77,15 @@ jobs:
6677
6778 if [[ -z "$PR_NUMBER" ]]; then
6879 echo "Failed to create PR"
80+ echo "SKIP_PR=true" >> $GITHUB_ENV
6981 exit 0
7082 fi
7183
7284 echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
7385
7486 - name : Check PR status
7587 id : check_pr
88+ if : ${{ env.SKIP_PR != 'true' }}
7689 env :
7790 GITHUB_TOKEN : ${{ secrets.PAT_SERVICE_ACCOUNT }}
7891 run : |
@@ -104,11 +117,12 @@ jobs:
104117 done
105118
106119 - name : Merge PR and create tag
120+ if : ${{ env.SKIP_PR != 'true' }}
107121 env :
108122 GITHUB_TOKEN : ${{ secrets.PAT_SERVICE_ACCOUNT }}
109123 run : |
110124 # Merge PR
111- gh pr merge $PR_NUMBER --merge
125+ gh pr merge $PR_NUMBER --merge --admin
112126
113127 # Create tag
114128 git fetch origin dev
You can’t perform that action at this time.
0 commit comments