@@ -119,6 +119,40 @@ jobs:
119119 ${{ github.event_name == 'schedule' || (github.event_name == 'pull_request' &&
120120 contains(steps.pr-labels.outputs.labels, ' ci-skip-cache ')) }}
121121
122+
123+ job_can_merge_into_develop :
124+ name : Can Merge Into Develop
125+ needs : job_get_metadata
126+ runs-on : ubuntu-24.04
127+ # Only run this on PRs against develop
128+ if : github.event_name == 'pull_request' && github.base_ref == 'refs/heads/develop'
129+ steps :
130+ - name : Check out current commit
131+ uses : actions/checkout@v5
132+ with :
133+ ref : ${{ env.HEAD_COMMIT }}
134+
135+ - name : Check if master is not ahead of develop
136+ run : |
137+ # Get commit counts: left=develop unique commits, right=master unique commits
138+ COUNTS=$(git rev-list --left-right --count origin/develop...origin/master)
139+ LEFT=$(echo "$COUNTS" | cut -f1)
140+ RIGHT=$(echo "$COUNTS" | cut -f2)
141+
142+ echo "Commits unique to develop: $LEFT"
143+ echo "Commits unique to master: $RIGHT"
144+
145+ # Fail if master has commits that develop doesn't have (master is ahead)
146+ if [ "$RIGHT" -gt 0 ]; then
147+ echo "Error: master is ahead of develop by $RIGHT commits"
148+ echo "Please merge master into develop or ensure master is not ahead"
149+ exit 1
150+ else
151+ echo "✓ master is not ahead of develop"
152+ fi
153+
154+
155+
122156 job_build :
123157 name : Build
124158 needs : job_get_metadata
@@ -1168,6 +1202,7 @@ jobs:
11681202 job_lint,
11691203 job_check_format,
11701204 job_circular_dep_check,
1205+ job_can_merge_into_develop,
11711206 ]
11721207 # Always run this, even if a dependent job failed
11731208 if : always()
0 commit comments