Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
88 changes: 88 additions & 0 deletions .github/scripts/bot-gfi-candidate-notification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Script to notify the team when a Good First Issue Candidate is created.

const marker = '<!-- GFI Candidate Notification -->';
const TEAM_ALIAS = '@hiero-ledger/hiero-sdk-good-first-issue-support';


async function notifyTeam(github, owner, repo, issue, message) {
const dryRun = process.env.DRY_RUN === 'true';
if (dryRun) {
console.log('Notified team about GFI candidate');
console.log(`Repo: ${owner}/${repo}`);
console.log(`Issue: #${issue.number} - ${issue.title}`);
console.log(`Message:\n${message}`);
return true;
}
const comment = `${marker} :wave: Hello Team :wave:
${TEAM_ALIAS}
${message}
Repository: ${owner}/${repo}
Issue: #${issue.number} - ${issue.title || '(no title)'}
Best Regards,
Hiero Python SDK team`;

try {
await github.rest.issues.createComment({
owner,
repo,
issue_number: issue.number,
body: comment,
});
console.log(`Notified team about #${issue.number}`);
return true;
} catch (err) {
console.log(
`Failed to notify team about GFI candidate #${issue.number}:`,
err.message || err
);
return false;
}
}

module.exports = async ({ github, context }) => {
try {
const { owner, repo } = context.repo;
const { issue, label } = context.payload;
const dryRun = process.env.DRY_RUN === 'true';

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

// Only handle Good First Issue Candidate
if (label.name.toLowerCase() !== 'good first issue candidate') {
return;
}

// Checking dry run
dryRun && console.log('DRY-RUN active');

// Prevent duplicate notifications
const comments = await github.paginate(
github.rest.issues.listComments,
{ owner, repo, issue_number: issue.number, per_page: 100 }
);

if (comments.some(c => c.body?.includes(marker))) {
return console.log(`Notification already exists for #${issue.number}`);
}

const message =
'A new Good First Issue Candidate has been created. Please review it and confirm whether it should be labeled as a Good First Issue.';

const success = await notifyTeam(github, owner, repo, issue, message);

if (success) {
console.log('=== Summary ===');
console.log(`Repository: ${owner}/${repo}`);
console.log(`Issue Number: ${issue.number}`);
console.log(`Label: ${label.name}`);
}
} catch (err) {
console.log('❌ Error:', err.message);
throw err;
}
};
39 changes: 39 additions & 0 deletions .github/workflows/bot-gfi-candidate-notification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow notifies the GFI support team when an issue is labeled as GFI Candidate.

name: Good First Issue Candidate Notification

on:
issues:
types:
- labeled

permissions:
issues: write
contents: read

jobs:
gfi_candidate_notify_team:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'good first issue candidate')
concurrency:
group: gfi-candidate-${{ github.event.issue.number }}
cancel-in-progress: false

steps:
- name: Harden the runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1

- name: Notify team of GFI candidate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: ${{ github.repository_owner != 'hiero-ledger' }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd #v8.0.0
with:
script: |
const script = require('./.github/scripts/bot-gfi-candidate-notification.js');
await script({ github, context });
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
## [Unreleased]

### Added

- Added a notification workflow that alerts the support team when an issue is labeled as a Good First Issue Candidate.[(#1296)]
- Added comprehensive training documentation for the `Query` class, covering execution flow, payments, retries, and building child queries. (#1238)
- Beginner issue documentation and updated GFI and GFIC templates and documentation
- Enable auto assignment to good first issues (#1312), archived good first issue support team notification. Changed templates with new assign instruction.
- Intermediate issue documentation
- Added unit test for 'endpoint.py' to increase coverage.
- 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)
- Added Hbar object support for TransferTransaction HBAR transfers:
- Methods now accept `Union[int, Hbar]` for amount parameters with immediate normalization to tinybars
- Includes comprehensive unit tests covering various Hbar units (HBAR, MICROBAR, NANOBAR, TINYBAR) and accumulation behavior with mixed `int` and `Hbar` inputs
- 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)
- Methods now accept `Union[int, Hbar]` for amount parameters with immediate normalization to tinybars
- Includes comprehensive unit tests covering various Hbar units (HBAR, MICROBAR, NANOBAR, TINYBAR) and accumulation behavior with mixed `int` and `Hbar` inputs
- 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)
- Added a GitHub Actions workflow to validate broken Markdown links in pull requests.
- Added method chaining examples to the developer training guide (`docs/sdk_developers/training/coding_token_transactions.md`) (#1194)
- Added documentation explaining how to pin GitHub Actions to specific commit SHAs (`docs/sdk_developers/how-to-pin-github-actions.md`)(#1211)
Expand Down