Skip to content

Commit 042ff00

Browse files
Fix advanced check email spam on non-advanced issues
Signed-off-by: Siddhartha Ganguly <gangulysiddhartha22@gmail.com>
1 parent 1b07935 commit 042ff00

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed
Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: PythonBot - Advanced Requirement Check
2-
32
on:
43
issues:
54
types: [assigned, labeled]
6-
75
workflow_dispatch:
86
inputs:
97
dry_run:
@@ -15,56 +13,49 @@ on:
1513
description: "GitHub username to dry-run qualification check"
1614
required: true
1715
type: string
18-
1916
permissions:
20-
contents: read # required for actions/checkout
17+
contents: read
2118
issues: write
22-
2319
concurrency:
2420
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
2521
cancel-in-progress: true
26-
2722
jobs:
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

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
200200
- Update changelog workflow to trigger automatically on pull requests instead of manual dispatch (#1567)
201201

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

0 commit comments

Comments
 (0)