Skip to content
Closed
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
41 changes: 41 additions & 0 deletions .github/workflows/bot-verified-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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.PAT_TOKEN }}
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
REPO="${{ github.repository }}"

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='Hi, I'\''m PythonBot. Your pull request has commits that are not verified. For your PR to be merged, all commits must be signed and verified. Please see docs/sdk_developers/signing.md, README.md, docs/discord.md. To sign commits: git commit -S -s -m "Your message here". Thank you!'

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

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
## [Unreleased]

### Added
- workflow: github bot to respond to unverified PR commits
- 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