Skip to content

Commit 4cc2bd0

Browse files
exploreriiiparvninama
authored andcommitted
fix: prevent dry-run errors in GFI candidate notification
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
1 parent 85eb5ba commit 4cc2bd0

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.github/scripts/bot-gfi-candidate-notification.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
const marker = '<!-- GFI Candidate Notification -->';
44
const TEAM_ALIAS = '@hiero-ledger/hiero-sdk-good-first-issue-support';
55

6+
67
async function notifyTeam(github, owner, repo, issue, message) {
8+
const dryRun = process.env.DRY_RUN === 'true';
79
if (dryRun) {
810
console.log('Notified team about GFI candidate');
911
console.log(`Repo: ${owner}/${repo}`);
@@ -44,20 +46,20 @@ module.exports = async ({ github, context }) => {
4446
try {
4547
const { owner, repo } = context.repo;
4648
const { issue, label } = context.payload;
49+
const dryRun = process.env.DRY_RUN === 'true';
4750

4851
if (!issue?.number || !label?.name) {
4952
return console.log('Missing issue or label in payload');
5053
}
5154

5255
// Only handle Good First Issue Candidate
53-
if (label.name !== 'good first issue candidate') {
56+
if (label.name.toLowerCase() !== 'good first issue candidate') {
5457
return;
5558
}
5659

57-
//
60+
// Checking dry run
5861
dryRun && console.log('DRY-RUN active');
5962

60-
6163
// Prevent duplicate notifications
6264
const comments = await github.paginate(
6365
github.rest.issues.listComments,
@@ -81,5 +83,6 @@ module.exports = async ({ github, context }) => {
8183
}
8284
} catch (err) {
8385
console.log('❌ Error:', err.message);
86+
throw err;
8487
}
8588
};

.github/workflows/bot-gfi-candidate-notification.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ jobs:
3636
with:
3737
script: |
3838
const script = require('./.github/scripts/bot-gfi-candidate-notification.js');
39-
await script({ github, context, dryRun: process.env.DRY_RUN === 'true' });
39+
await script({ github, context });

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
77
## [Unreleased]
88

99
### Added
10+
11+
- Added a notification workflow that alerts the support team when an issue is labeled as a Good First Issue Candidate.[(#1296)]
1012
- Added comprehensive training documentation for the `Query` class, covering execution flow, payments, retries, and building child queries. (#1238)
1113
- Beginner issue documentation and updated GFI and GFIC templates and documentation
1214
- Enable auto assignment to good first issues (#1312), archived good first issue support team notification. Changed templates with new assign instruction.
1315
- Intermediate issue documentation
1416
- Added unit test for 'endpoint.py' to increase coverage.
1517
- Automated assignment guard for `advanced` issues; requires completion of at least one `good first issue` and one `intermediate` issue before assignment (exempts maintainers, committers, and triage members). (#1142)
1618
- Added Hbar object support for TransferTransaction HBAR transfers:
17-
- Methods now accept `Union[int, Hbar]` for amount parameters with immediate normalization to tinybars
18-
- Includes comprehensive unit tests covering various Hbar units (HBAR, MICROBAR, NANOBAR, TINYBAR) and accumulation behavior with mixed `int` and `Hbar` inputs
19-
- Added a module-level docstring to the HBAR allowance approval example to clarify
20-
delegated spending behavior and key concepts. [#1202](https://github.com/hiero-ledger/hiero-sdk-python/issues/1202)
19+
- Methods now accept `Union[int, Hbar]` for amount parameters with immediate normalization to tinybars
20+
- Includes comprehensive unit tests covering various Hbar units (HBAR, MICROBAR, NANOBAR, TINYBAR) and accumulation behavior with mixed `int` and `Hbar` inputs
21+
- Added a module-level docstring to the HBAR allowance approval example to clarify delegated spending behavior and key concepts. [#1202](https://github.com/hiero-ledger/hiero-sdk-python/issues/1202)
2122
- Added a GitHub Actions workflow to validate broken Markdown links in pull requests.
2223
- Added method chaining examples to the developer training guide (`docs/sdk_developers/training/coding_token_transactions.md`) (#1194)
2324
- Added documentation explaining how to pin GitHub Actions to specific commit SHAs (`docs/sdk_developers/how-to-pin-github-actions.md`)(#1211)

0 commit comments

Comments
 (0)