Skip to content

Commit da353b2

Browse files
committed
workflow bot back in
Signed-off-by: nadineloepfe <[email protected]>
1 parent 1b9711e commit da353b2

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: PythonBot - Workflow Failure Notifier
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_run:
6+
workflows:
7+
- "PR Formatting"
8+
- "Hiero Solo Integration Tests"
9+
- "Run Examples"
10+
types:
11+
- completed
12+
13+
permissions:
14+
contents: read
15+
pull-requests: write
16+
17+
jobs:
18+
notify-pr:
19+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Get associated PR number
23+
id: get-pr
24+
run: |
25+
# Get "id" from the workflow run
26+
HEAD_BRANCH=$(gh run view ${{ github.event.workflow_run.id }} \
27+
--repo ${{ github.repository }} \
28+
--json headBranch --jq '.headBranch')
29+
30+
# Find the PR number for this branch
31+
PR_NUMBER=$(gh pr list --repo ${{ github.repository }} --state all --head "$HEAD_BRANCH" --json number --jq '.[0].number')
32+
33+
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
34+
35+
36+
- name: Comment on PR
37+
if: env.PR_NUMBER != ''
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
run: |
41+
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
58+
EOF
59+
)
60+
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$COMMENT"

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
88

99

1010
### Added
11+
- 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.
1113
- Add `examples/token_create_transaction_max_automatic_token_associations_0.py` to demonstrate how `max_automatic_token_associations=0` behaves.
1214
- Add `examples/topic_id.py` to demonstrate `TopicId` opeartions
1315
- Add `examples/topic_message.py` to demonstrate `TopicMessage` and `TopicMessageChunk` with local mock data.

0 commit comments

Comments
 (0)