mirror of
https://github.com/NeoCloud/NeoNetwork
synced 2024-11-22 16:40:41 +08:00
test-your-pr: fix bot comment: actions/github-script is much better [skip ci]
Signed-off-by: Jerry <isjerryxiao@outlook.com>
This commit is contained in:
parent
30b2c1a057
commit
70891fe946
1 changed files with 20 additions and 8 deletions
28
.github/workflows/test-your-pr.yml
vendored
28
.github/workflows/test-your-pr.yml
vendored
|
@ -52,11 +52,16 @@ jobs:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
if: ${{ always() && contains(needs.build.result, 'success') }}
|
if: ${{ always() && contains(needs.build.result, 'success') }}
|
||||||
steps:
|
steps:
|
||||||
- uses: thollander/actions-comment-pull-request@v2
|
- uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.COMMENT_GITHUB_TOKEN }}
|
github-token: ${{secrets.COMMENT_GITHUB_TOKEN}}
|
||||||
message: |
|
script: |
|
||||||
Congratulations! Your pull request passed the check.
|
github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: 'Congratulations! Your pull request passed the check.'
|
||||||
|
})
|
||||||
|
|
||||||
comment_failure:
|
comment_failure:
|
||||||
needs: [build]
|
needs: [build]
|
||||||
|
@ -65,11 +70,18 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo ${{needs.build.outputs.generate_roa}} | base64 -d |tail > /tmp/buildjob_tail.log || echo 'internal error' > /tmp/buildjob_tail.log
|
echo ${{needs.build.outputs.generate_roa}} | base64 -d | tr -d '`' |tail > /tmp/buildjob_tail.log || echo 'internal error' > /tmp/buildjob_tail.log
|
||||||
|
|
||||||
- uses: thollander/actions-comment-pull-request@v2
|
- uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.COMMENT_GITHUB_TOKEN }}
|
github-token: ${{secrets.COMMENT_GITHUB_TOKEN}}
|
||||||
filePath: /tmp/buildjob_tail.log
|
script: |
|
||||||
|
const fs = require('fs')
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: fs.readFileSync('/tmp/buildjob_tail.log')
|
||||||
|
})
|
||||||
|
|
||||||
- run: false
|
- run: false
|
||||||
|
|
Loading…
Reference in a new issue