build-start #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Commment PR | |
on: | |
repository_dispatch: | |
types: [build-start, build-finish, build-fail] | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
comment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Find Comment | |
uses: peter-evans/find-comment@v2 | |
id: fc | |
with: | |
issue-number: ${{ github.event.client_payload.pr-number }} | |
comment-author: "github-actions[bot]" | |
body-includes: "## ci-bot\n\n" | |
- name: Comment build start message | |
if: ${{ github.event.action == 'build-start' }} | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ github.event.client_payload.pr-number }} | |
body: | | |
## ci-bot | |
Now I'm building the new package reflecting the changes of this PR. Please be patient. | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
- name: Comment build finish message | |
if: ${{ github.event.action == 'build-finish' }} | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ github.event.client_payload.pr-number }} | |
body: | | |
## ci-bot | |
CI build finished. Use the link below to test the packge: | |
``` | |
${{ github.event.client_payload.release-url }} | |
``` | |
For example, in `npm`: | |
```bash | |
npm i ${{ github.event.client_payload.release-url }} | |
``` | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
edit-mode: replace | |
- name: Comment build fail message | |
if: ${{ github.event.action == 'build-fail' }} | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ github.event.client_payload.pr-number }} | |
body: | | |
## ci-bot | |
CI Build failed. | |
comment-id: ${{ steps.fc.outputs.comment-id }} |