@@ -195,6 +195,63 @@ jobs:
195195 new_checksum=${{needs.compiler-tests.outputs.checksum}}
196196 [[ "$old_checksum" == "$new_checksum" ]];
197197
198+ phar-prefix-diff :
199+ name : " PHAR Prefix Diff"
200+ if : github.event_name == 'pull_request' && needs.compiler-tests.outputs.compiler_changed == 'true'
201+ needs : compiler-tests
202+ runs-on : " ubuntu-latest"
203+ steps :
204+ - uses : actions/checkout@v4
205+
206+ - name : Get base commit SHA
207+ id : base
208+ run : echo "base_sha=${{ github.event.pull_request.base.sha }}" >> "$GITHUB_OUTPUT"
209+
210+ - name : Set up Node.js
211+ uses : actions/setup-node@v4
212+ with :
213+ node-version : 20
214+
215+ - name : Install dependencies
216+ working-directory : .github/scripts
217+ run : npm ci
218+
219+ - name : " Compile TS scripts"
220+ working-directory : .github/scripts
221+ run : npx tsc
222+
223+ - name : Find phar-file-checksum from base commit
224+ id : find-artifact
225+ uses : actions/github-script@v7
226+ env :
227+ BASE_SHA : ${{ steps.base.outputs.base_sha }}
228+ ARTIFACT_NAME : phar-file-checksum
229+ WORKFLOW_NAME : Compile PHAR
230+ with :
231+ script : |
232+ const script = require('./.github/scripts/dist/find-artifact.js');
233+ await script({github, context, core})
234+
235+ # saved to phar-file-checksum/phpstan.phar
236+ - name : Download old artifact by ID
237+ uses : actions/download-artifact@v4
238+ with :
239+ artifact-ids : ${{ steps.find-artifact.outputs.artifact_id }}
240+ run-id : ${{ steps.find-artifact.outputs.run_id }}
241+ github-token : ${{ secrets.GITHUB_TOKEN }}
242+
243+ # saved to phpstan.phar
244+ - name : " Download phpstan.phar"
245+ uses : actions/download-artifact@v4
246+ with :
247+ name : phar-file-checksum
248+
249+ - name : " New checksum"
250+ run : echo $(md5sum phpstan.phar | cut -d' ' -f1)
251+
252+ - name : " Old checksum"
253+ run : echo $(md5sum phar-file-checksum/phpstan.phar | cut -d' ' -f1)
254+
198255
199256 commit :
200257 name : " Commit PHAR"
0 commit comments