Skip to content

Commit f60af93

Browse files
authored
fix: commit verify + workflow bot - PR_NUMBER syntax, GH_TOKEN env var add, YAML syntax (#836)
Signed-off-by: nadineloepfe <[email protected]>
1 parent 0bd1f9e commit f60af93

File tree

3 files changed

+23
-28
lines changed

3 files changed

+23
-28
lines changed

.github/workflows/bot-verified-commits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
PR_NUMBER=${{ github.event.pull_request.number }}
2828
REPO="${{ github.repository }}"
29-
COMMITS_URL="https://github.com/$REPO/pull/${{ PR_NUMBER }}/commits"
29+
COMMITS_URL="https://github.com/$REPO/pull/${PR_NUMBER}/commits"
3030
3131
echo "Checking commits in PR #$PR_NUMBER for repository $REPO..."
3232
Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: PythonBot - Workflow Failure Notifier
2-
32
on:
43
workflow_dispatch:
54
workflow_run:
@@ -9,52 +8,48 @@ on:
98
- "Run Examples"
109
types:
1110
- completed
12-
1311
permissions:
1412
contents: read
1513
pull-requests: write
16-
1714
jobs:
1815
notify-pr:
1916
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
2017
runs-on: ubuntu-latest
2118
steps:
2219
- name: Get associated PR number
2320
id: get-pr
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2423
run: |
25-
# Get "id" from the workflow run
24+
# Get branch from the workflow run
2625
HEAD_BRANCH=$(gh run view ${{ github.event.workflow_run.id }} \
2726
--repo ${{ github.repository }} \
2827
--json headBranch --jq '.headBranch')
29-
28+
3029
# Find the PR number for this branch
3130
PR_NUMBER=$(gh pr list --repo ${{ github.repository }} --state all --head "$HEAD_BRANCH" --json number --jq '.[0].number')
32-
3331
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
34-
35-
32+
3633
- name: Comment on PR
3734
if: env.PR_NUMBER != ''
3835
env:
3936
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4037
run: |
4138
REPO="${{ github.repository }}"
42-
COMMENT=$(cat <<EOF
43-
Hi, this is WorkflowBot.
44-
Your pull request cannot be merged as it is not passing all our workflow checks.
45-
Please click on each check to review the logs and resolve issues so all checks pass.
46-
47-
To help you:
48-
- [DCO signing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md)
49-
- [Changelog guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md)
50-
- [Merge conflicts guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/merge_conflicts.md)
51-
- [Rebase guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/rebasing.md)
52-
- [Testing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/testing.md)
53-
- [Discord](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/discord.md)
54-
- [Community Calls](https://zoom-lfx.platform.linuxfoundation.org/meetings/hiero?view=week)
55-
56-
Thank you for contributing!
57-
From the Hiero Python SDK Team
39+
COMMENT=$(cat <<EOF
40+
Hi, this is WorkflowBot.
41+
Your pull request cannot be merged as it is not passing all our workflow checks.
42+
Please click on each check to review the logs and resolve issues so all checks pass.
43+
To help you:
44+
- [DCO signing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md)
45+
- [Changelog guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md)
46+
- [Merge conflicts guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/merge_conflicts.md)
47+
- [Rebase guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/rebasing.md)
48+
- [Testing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/testing.md)
49+
- [Discord](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/discord.md)
50+
- [Community Calls](https://zoom-lfx.platform.linuxfoundation.org/meetings/hiero?view=week)
51+
Thank you for contributing!
52+
From the Hiero Python SDK Team
5853
EOF
59-
)
60-
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$COMMENT"
54+
)
55+
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$COMMENT"

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
99

1010
### Added
1111
- Add workflow: github bot to respond to unverified PR commits (#750)
12+
- Add workflow: bot workflow which notifies developers of workflow failures in their pull requests.
1213
- Add `examples/token_create_transaction_max_automatic_token_associations_0.py` to demonstrate how `max_automatic_token_associations=0` behaves.
1314
- Add `examples/topic_id.py` to demonstrate `TopicId` opeartions
1415
- Add `examples/topic_message.py` to demonstrate `TopicMessage` and `TopicMessageChunk` with local mock data.
@@ -23,7 +24,6 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
2324
- `alias`, `staked_account_id`, `staked_node_id` and `decline_staking_reward` fields to AccountCreateTransaction
2425
- `staked_account_id`, `staked_node_id` and `decline_staking_reward` fields to AccountInfo
2526
- Added `examples/token_create_transaction_supply_key.py` to demonstrate token creation with and without a supply key.
26-
- workflow: bot workflow which notifies developers of workflow failures in their pull requests.
2727

2828
### Changed
2929
- Refactored token-related example scripts (`token_delete.py`, `token_dissociate.py`, etc.) for improved readability and modularity. [#370]

0 commit comments

Comments
 (0)