File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88jobs :
99 create-pull-request :
1010 runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+ pull-requests : write
1114 steps :
1215 - name : Checkout code
1316 uses : actions/checkout@v3
1417 with :
1518 fetch-depth : 0
19+ ref : master
20+
21+ - name : Check if main and master are different
22+ id : check-diff
23+ run : |
24+ git fetch origin main:main
25+ DIFF_COUNT=$(git rev-list --count main..master)
26+ echo "diff_count=$DIFF_COUNT" >> $GITHUB_OUTPUT
27+ if [ "$DIFF_COUNT" -gt 0 ]; then
28+ echo "Differences found between main and master. Will create PR."
29+ else
30+ echo "No differences found between main and master. Skipping PR creation."
31+ fi
1632
1733 - name : Create Pull Request
34+ if : steps.check-diff.outputs.diff_count > 0
1835 uses : peter-evans/create-pull-request@v5
1936 with :
2037 token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments