Skip to content

Commit 2f125f3

Browse files
gangulysiddhartha22-cmykAkshayKumarSahu
authored andcommitted
fix: reduce notification spam by skipping advanced check job on non-advanced issues (hiero-ledger#1580)
Signed-off-by: Siddhartha Ganguly <gangulysiddhartha22@gmail.com> Signed-off-by: AkshayKumarSahu <your_verified_email>
1 parent 0591696 commit 2f125f3

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed
Lines changed: 25 additions & 29 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,54 @@ 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: >
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

CHANGELOG.md

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

206206
### Fixed
207+
- Reduced notification spam by skipping the entire advanced qualification job for non-advanced issues and irrelevant events (#1517)
207208
- Aligned token freeze example filename references and improved error handling by catching broader exceptions with clearer messages. (#1412)
208209
- Fixed jq syntax in bot-office-hours.sh (#1502)
209210
- Fixed formatting of `/unassign` command in the PR inactivity reminder message so it displays correctly with backticks. (#1582)

0 commit comments

Comments
 (0)