Skip to content
Open
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
58 changes: 58 additions & 0 deletions .github/workflows/bot-verified-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: PythonBot - Verify PR Commits

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

permissions:
contents: read
pull-requests: write

jobs:
verify-commits:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Check for unverified commits
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
REPO="${{ github.repository }}"
COMMITS_URL="https://github.com/$REPO/pull/${{ PR_NUMBER }}/commits"

echo "Checking commits in PR #$PR_NUMBER for repository $REPO..."

COMMITS_JSON=$(gh api repos/$REPO/pulls/$PR_NUMBER/commits)
UNVERIFIED_COUNT=$(echo "$COMMITS_JSON" | jq '[.[] | select(.commit.verification.verified == false)] | length')

echo "Unverified commits: $UNVERIFIED_COUNT"

if [ "$UNVERIFIED_COUNT" -gt 0 ]; then
COMMENT=$(cat <<EOF
Hi, this is VerificationBot.
Your pull request cannot be merged as it has **unverified commits**.
View your commit verification status: [Commits Tab]($COMMITS_URL).

To achieve verified status, please read:
- [Signing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md)
- [README](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/README.md)
- [Discord](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/discord.md)

Remember, you require a GPG key and each commit must be signed with:
\`git commit -S -s -m "Your message here"\`

Thank you for contributing!

From the Hiero Python SDK Team
EOF )

gh pr view $PR_NUMBER --repo $REPO --json comments --jq '.comments[].body' | grep -F "PythonBot" >/dev/null || \
(gh pr comment $PR_NUMBER --repo $REPO --body "$COMMENT" && echo "Comment added to PR #$PR_NUMBER")
else
echo "All commits in PR #$PR_NUMBER are verified."
fi

3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ This project adheres to [Semantic Versioning](https://semver.org).
This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Added
- workflow: github bot to respond to unverified PR commits (#750)
- Add `TokenFeeScheduleUpdateTransaction` class to support updating custom fee schedules on tokens (#471).
- Add `examples/token_update_fee_schedule_fungible.py` and `examples/token_update_fee_schedule_nft.py` demonstrating the use of `TokenFeeScheduleUpdateTransaction`.
- Update `docs/sdk_users/running_examples.md` to include `TokenFeeScheduleUpdateTransaction`.
Expand Down