File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 ECR_REPOSITORY : " roboverse-dev"
2424
2525jobs :
26- pre-merge-tests :
26+ pre-merge-tests-impl :
2727 if : github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch'
2828 permissions :
2929 contents : read
@@ -396,6 +396,26 @@ jobs:
396396 if-no-files-found : warn
397397 retention-days : 7
398398
399+ pre-merge-tests :
400+ if : always()
401+ needs : [workflow-integrity-check, pre-merge-tests-impl]
402+ runs-on : ubuntu-latest
403+ steps :
404+ - run : |
405+ if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
406+ if [[ "${{ needs.workflow-integrity-check.result }}" != "success" ]]; then
407+ echo "❌ Workflow integrity check failed."
408+ exit 1
409+ fi
410+ echo "✅ Workflow integrity verified. Ready for merge queue."
411+ elif [[ "${{ github.event_name }}" == "merge_group" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
412+ if [[ "${{ needs.pre-merge-tests-impl.result }}" != "success" ]]; then
413+ echo "❌ Tests failed."
414+ exit 1
415+ fi
416+ echo "✅ Tests passed."
417+ fi
418+
399419 workflow-integrity-check :
400420 runs-on : ubuntu-latest
401421 if : github.event_name == 'pull_request_target'
@@ -409,7 +429,7 @@ jobs:
409429 run : |
410430 set -euo pipefail
411431 echo "Checking if .github/workflows/premerge-ci.yml is modified in PR #$PR_NUMBER..."
412- CHANGES=$(gh pr diff "$PR_NUMBER" --name-only)
432+ CHANGES=$(gh pr diff "$PR_NUMBER" --name-only -R ${{ github.repository }} )
413433
414434 if echo "$CHANGES" | grep -q "^.github/workflows/premerge-ci.yml$"; then
415435 echo "❌ Critical workflow modification detected!"
You can’t perform that action at this time.
0 commit comments