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 : >
33- (
34- github.event_name == 'issues' &&
35- contains(github.event.issue.labels.*.name, 'advanced') &&
36- (
37- github.event.action == 'assigned' ||
38- (
39- github.event.action == 'labeled' &&
40- github.event.label.name == 'advanced' &&
41- github.event.issue.assignees[0] != null
42- )
43- )
44- ) ||
45- github.event_name == 'workflow_dispatch'
46-
27+ # steps are skipped, job completes successfully
4728 runs-on : ubuntu-latest
48-
4929 steps :
30+ - name : Filter
31+ id : should_run
32+ run : echo "value=true" >> $GITHUB_OUTPUT
33+ if : |
34+ github.event_name == 'workflow_dispatch' ||
35+ (
36+ github.event_name == 'issues' &&
37+ contains(github.event.issue.labels.*.name, 'advanced') &&
38+ (
39+ github.event.action == 'assigned' ||
40+ (github.event.action == 'labeled' && github.event.label.name == 'advanced' && join(github.event.issue.assignees.*.login, ',') != '')
41+ )
42+ )
43+ - name : Log skip reason
44+ if : steps.should_run.outputs.value != 'true'
45+ run : |
46+ echo "::notice::Skipping: event=${{ github.event_name }}, action=${{ github.event.action }}, has_advanced_label=${{ contains(github.event.issue.labels.*.name, 'advanced') }}"
5047 - name : Checkout scripts
48+ if : steps.should_run.outputs.value == 'true'
5149 uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5250 with :
53- sparse-checkout : .github/scripts
51+ sparse-checkout : |
52+ .github/scripts
53+ sparse-checkout-cone-mode : false
5454
5555 - name : Verify User Qualification
56+ if : steps.should_run.outputs.value == 'true'
5657 env :
5758 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5859 REPO : ${{ github.repository }}
59-
60- # Issue-driven execution
6160 TRIGGER_ASSIGNEE : ${{ github.event.assignee.login || '' }}
6261 ISSUE_NUMBER : ${{ github.event.issue.number || '' }}
63-
64- # Manual execution (workflow_dispatch)
6562 DRY_RUN : ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || 'false' }}
6663 DRY_RUN_USER : ${{ github.event_name == 'workflow_dispatch' && inputs.username || '' }}
67-
6864 run : |
6965 chmod +x .github/scripts/bot-advanced-check.sh
70- ./. github/scripts/bot-advanced-check.sh
66+ .github/scripts/bot-advanced-check.sh
0 commit comments