Skip to content

Commit afb2eed

Browse files
committed
New CI process to re-use comments
Signed-off-by: worksofliam <[email protected]>
1 parent c8fe3ce commit afb2eed

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/webpack_ci.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,34 @@ jobs:
4040
name: test_vsix
4141
path: ${{env.vsix_name}}
4242

43+
- name: Find Comment
44+
uses: peter-evans/find-comment@v1
45+
id: fc
46+
with:
47+
issue-number: ${{ github.event.pull_request.number }}
48+
comment-author: 'github-actions[bot]'
49+
body-includes: new build is available
50+
4351
- name: Post comment
52+
if: steps.fc.outputs.comment-id == ''
4453
uses: actions/github-script@v5
4554
with:
4655
script: |
4756
github.rest.issues.createComment({
4857
issue_number: context.issue.number,
4958
owner: context.repo.owner,
5059
repo: context.repo.repo,
51-
body: '👋 A new build is available for this PR based on ${{ github.event.pull_request.head.sha }}.\n * [Download here.](https://github.com/halcyon-tech/vscode-db2i/actions/runs/${{ github.run_id }})\n'
60+
body: '👋 A new build is available for this PR based on ${{ github.event.pull_request.head.sha }}.\n * [Download here.](https://github.com/codefori/vscode-ibmi/actions/runs/${{ github.run_id }})\n* [Read more about how to test](https://github.com/codefori/vscode-ibmi/blob/master/.github/pr_testing_template.md)'
5261
})
62+
63+
- name: Update comment
64+
if: steps.fc.outputs.comment-id != ''
65+
uses: peter-evans/create-or-update-comment@v1
66+
with:
67+
edit-mode: replace
68+
comment-id: ${{ steps.fc.outputs.comment-id }}
69+
body: |
70+
👋 A new build is available for this PR based on ${{ github.event.pull_request.head.sha }}.
71+
72+
* [Download here.](https://github.com/codefori/vscode-ibmi/actions/runs/${{ github.run_id }})
73+
* [Read more about how to test](https://github.com/codefori/vscode-ibmi/blob/master/.github/pr_testing_template.md)

0 commit comments

Comments
 (0)