Skip to content

Commit a8afff5

Browse files
authored
Improve PR comment event trigger (#4307)
* Add GitHub Actions comments for workflow run status in PR
1 parent 3447bb7 commit a8afff5

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/pr_comment_trigger.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ jobs:
1818
runs-on: [self-hosted, linux, x64, dev, dmount]
1919
name: PR-Comment-Integration-Tests
2020
steps:
21+
- name: Post workflow run link in PR
22+
uses: actions/github-script@v7
23+
with:
24+
script: |
25+
const prUrl = context.payload.issue.pull_request.url;
26+
const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
27+
await github.rest.issues.createComment({
28+
issue_number: context.issue.number,
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
body: `🚀 Workflow run started: [View run](${runUrl})`
32+
});
33+
2134
- name: Checkout repository
2235
uses: actions/checkout@v4
2336

@@ -53,3 +66,20 @@ jobs:
5366
5467
echo "✅ Running integration test for: $TASK_NAME"
5568
tox -vv -e "integration-test-${TASK_NAME}"
69+
70+
- name: Post result to PR
71+
uses: actions/github-script@v7
72+
with:
73+
script: |
74+
const conclusion = "${{ job.status }}";
75+
const message = conclusion === "success"
76+
? "✅ Workflow succeeded!"
77+
: conclusion === "failure"
78+
? "❌ Workflow failed."
79+
: "⚠️ Workflow finished with status: " + conclusion;
80+
await github.rest.issues.createComment({
81+
issue_number: context.issue.number,
82+
owner: context.repo.owner,
83+
repo: context.repo.repo,
84+
body: message
85+
});

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ All notable changes to this project will be documented in this file.
2424
(<https://github.com/openvinotoolkit/training_extensions/pull/4184>)
2525
- Add UFlow anomaly detection algorithm
2626
(<https://github.com/openvinotoolkit/training_extensions/pull/4251>)
27+
- Improve Pre-Merge Test
28+
(<https://github.com/openvinotoolkit/training_extensions/pull/4307>)
2729

2830
### Enhancements
2931

0 commit comments

Comments
 (0)