Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 11 additions & 21 deletions .github/workflows/bot-advanced-check.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: PythonBot - Advanced Requirement Check

on:
issues:
types: [assigned, labeled]

workflow_dispatch:
inputs:
dry_run:
Expand All @@ -15,56 +13,48 @@ on:
description: "GitHub username to dry-run qualification check"
required: true
type: string

permissions:
contents: read # required for actions/checkout
contents: read
issues: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
cancel-in-progress: true

jobs:
#######################################
# Automatic enforcement + manual dry-run
#######################################
check-advanced-qualification:
if: >
# Skip the entire job (no run steps, no checkout, minimal visibility) when not relevant
if: |-
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'issues' &&
contains(github.event.issue.labels.*.name, 'advanced') &&
(
github.event.action == 'assigned' ||
(
github.event.action == 'labeled' &&
github.event.label.name == 'advanced' &&
github.event.issue.assignees[0] != null
join(github.event.issue.assignees.*.login, ',') != ''
)
)
) ||
github.event_name == 'workflow_dispatch'

)
runs-on: ubuntu-latest

steps:
- name: Checkout scripts
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # Current v4 tag SHA
with:
sparse-checkout: .github/scripts
sparse-checkout: |
.github/scripts
sparse-checkout-cone-mode: false

- name: Verify User Qualification
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}

# Issue-driven execution
TRIGGER_ASSIGNEE: ${{ github.event.assignee.login || '' }}
ISSUE_NUMBER: ${{ github.event.issue.number || '' }}

# Manual execution (workflow_dispatch)
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || 'false' }}
DRY_RUN_USER: ${{ github.event_name == 'workflow_dispatch' && inputs.username || '' }}

run: |
chmod +x .github/scripts/bot-advanced-check.sh
./.github/scripts/bot-advanced-check.sh
.github/scripts/bot-advanced-check.sh
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- Update changelog workflow to trigger automatically on pull requests instead of manual dispatch (#1567)

### Fixed
- Reduced notification spam by skipping the entire advanced qualification job for non-advanced issues and irrelevant events (#1517)
- Aligned token freeze example filename references and improved error handling by catching broader exceptions with clearer messages. (#1412)
- Fixed jq syntax in bot-office-hours.sh (#1502)
- Prevented linkbot from commenting on or auto-closing bot-authored pull requests. (#1516)
Expand Down