9797 - '.github/**'
9898 any_code:
9999 - '!**/*.md'
100+ any_package_json:
101+ - '**/package.json'
100102
101103 - name : Get PR labels
102104 id : pr-labels
@@ -110,6 +112,7 @@ jobs:
110112 is_release : ${{ startsWith(github.ref, 'refs/heads/release/') }}
111113 changed_ci : ${{ steps.changed.outputs.workflow == 'true' }}
112114 changed_any_code : ${{ steps.changed.outputs.any_code == 'true' }}
115+ changed_any_package_json : ${{ steps.changed.outputs.any_package_json == 'true' }}
113116
114117 # When merging into master, or from master
115118 is_gitflow_sync : ${{ github.head_ref == 'master' || github.ref == 'refs/heads/master' }}
@@ -119,13 +122,14 @@ jobs:
119122 ${{ github.event_name == 'schedule' || (github.event_name == 'pull_request' &&
120123 contains(steps.pr-labels.outputs.labels, ' ci-skip-cache ')) }}
121124
122-
123125 job_can_merge_into_develop :
124126 name : Can Merge Into Develop
125127 needs : job_get_metadata
126128 runs-on : ubuntu-24.04
127- # Only run this on PRs against develop
128- if : github.event_name == 'pull_request' && github.base_ref == 'develop'
129+ # Only run this on PRs against develop, if any package.json files were changed
130+ if :
131+ github.event_name == 'pull_request' && github.base_ref == 'develop' &&
132+ needs.job_get_metadata.outputs.changed_any_package_json == 'true'
129133 steps :
130134 - name : Check out current commit
131135 uses : actions/checkout@v5
@@ -135,7 +139,7 @@ jobs:
135139 - name : Check if master is not ahead of develop
136140 run : |
137141 # Get commit counts: left=develop unique commits, right=master unique commits
138- COUNTS=$(git rev-list --left-right --count develop...master)
142+ COUNTS=$(git rev-list --left-right --count origin/ develop...origin/ master)
139143 LEFT=$(echo "$COUNTS" | cut -f1)
140144 RIGHT=$(echo "$COUNTS" | cut -f2)
141145
@@ -151,8 +155,6 @@ jobs:
151155 echo "✓ master is not ahead of develop"
152156 fi
153157
154-
155-
156158 job_build :
157159 name : Build
158160 needs : job_get_metadata
0 commit comments