Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
56 changes: 26 additions & 30 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,54 @@ 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: >
(
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
)
)
) ||
github.event_name == 'workflow_dispatch'

# steps are skipped, job completes successfully
runs-on: ubuntu-latest

steps:
- name: Filter
id: should_run
run: echo "value=true" >> $GITHUB_OUTPUT
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' && join(github.event.issue.assignees.*.login, ',') != '')
)
)
- name: Log skip reason
if: steps.should_run.outputs.value != 'true'
run: |
echo "::notice::Skipping: event=${{ github.event_name }}, action=${{ github.event.action }}, has_advanced_label=${{ contains(github.event.issue.labels.*.name, 'advanced') }}"
- name: Checkout scripts
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
if: steps.should_run.outputs.value == 'true'
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
if: steps.should_run.outputs.value == 'true'
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