11name : PythonBot - Advanced Requirement Check
2-
32on :
43 issues :
54 types : [assigned, labeled]
6-
75 workflow_dispatch :
86 inputs :
97 dry_run :
1513 description : " GitHub username to dry-run qualification check"
1614 required : true
1715 type : string
18-
1916permissions :
20- contents : read # required for actions/checkout
17+ contents : read
2118 issues : write
22-
2319concurrency :
2420 group : ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
2521 cancel-in-progress : true
26-
2722jobs :
2823 # ######################################
2924 # Automatic enforcement + manual dry-run
3025 # ######################################
3126 check-advanced-qualification :
32- if : >
27+ # Skip the entire job (no run steps, no checkout, minimal visibility) when not relevant
28+ if : ${{
29+ github.event_name == 'workflow_dispatch' ||
3330 (
34- github.event_name == 'issues' &&
35- contains(github.event.issue.labels.*.name, 'advanced') &&
31+ contains(github.event.issue.labels.*.name, 'advanced') &&
3632 (
37- github.event.action == 'assigned' ||
33+ github.event.action == 'assigned' ||
3834 (
39- github.event.action == 'labeled' &&
40- github.event.label.name == 'advanced' &&
41- github.event.issue.assignees[0] != null
35+ github.event.action == 'labeled' &&
36+ github.event.label.name == 'advanced' &&
37+ join( github.event.issue.assignees.*.login, ',') != ''
4238 )
4339 )
44- ) ||
45- github.event_name == 'workflow_dispatch'
46-
40+ )
41+ }}
4742 runs-on : ubuntu-latest
48-
4943 steps :
5044 - name : Checkout scripts
51- uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
45+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af1b8 # v4 (latest stable)
5246 with :
53- sparse-checkout : .github/scripts
47+ sparse-checkout : |
48+ .github/scripts
49+ sparse-checkout-cone-mode : false
5450
5551 - name : Verify User Qualification
5652 env :
5753 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5854 REPO : ${{ github.repository }}
59-
60- # Issue-driven execution
6155 TRIGGER_ASSIGNEE : ${{ github.event.assignee.login || '' }}
6256 ISSUE_NUMBER : ${{ github.event.issue.number || '' }}
63-
64- # Manual execution (workflow_dispatch)
6557 DRY_RUN : ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || 'false' }}
6658 DRY_RUN_USER : ${{ github.event_name == 'workflow_dispatch' && inputs.username || '' }}
67-
6859 run : |
6960 chmod +x .github/scripts/bot-advanced-check.sh
70- ./. github/scripts/bot-advanced-check.sh
61+ .github/scripts/bot-advanced-check.sh
0 commit comments