File tree Expand file tree Collapse file tree 1 file changed +37
-5
lines changed Expand file tree Collapse file tree 1 file changed +37
-5
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,44 @@ concurrency:
1818 cancel-in-progress : true
1919
2020jobs :
21+ gate :
22+ runs-on : ubuntu-latest
23+ outputs :
24+ eligible : ${{ steps.gate.outputs.eligible }}
25+ steps :
26+ - name : Decide eligibility (title starts with tested-with, same-repo PR)
27+ id : gate
28+ shell : bash
29+ run : |
30+ set -euo pipefail
31+ # Read and sanitize the PR title (handles quotes)
32+ title=${{ toJSON(github.event.pull_request.title) }}
33+ title=${title#\"}; title=${title%\"}
34+ head_repo="${{ github.event.pull_request.head.repo.full_name }}"
35+ base_repo="${{ github.repository }}"
36+
37+ title_ok=false
38+ if printf '%s' "$title" | grep -qiE '^tested-with'; then
39+ title_ok=true
40+ fi
41+
42+ same_repo=false
43+ if [ "$head_repo" = "$base_repo" ]; then
44+ same_repo=true
45+ fi
46+
47+ eligible=false
48+ if [ "$title_ok" = true ] && [ "$same_repo" = true ]; then
49+ eligible=true
50+ fi
51+
52+ echo "Eligibility: title_ok=$title_ok, same_repo=$same_repo, eligible=$eligible"
53+ echo "eligible=$eligible" >> "$GITHUB_OUTPUT"
54+
55+
2156 update-ci :
22- # Require: title starts with "tested-with" (case-insensitive)
23- # and PR originates from the same repository (safe to push back)
24- if : >
25- startsWith(toLower(github.event.pull_request.title), 'tested-with') &&
26- github.event.pull_request.head.repo.full_name == github.repository
57+ needs : gate
58+ if : needs.gate.outputs.eligible == 'true'
2759 runs-on : ubuntu-latest
2860
2961 steps :
You can’t perform that action at this time.
0 commit comments