@@ -37,17 +37,27 @@ jobs:
3737 fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
3838 - run : unzip pr.zip
3939
40- - name : ' Comment on PR'
41- uses : actions/github-script@v3
40+
41+ - name : Find Comment
42+ continue-on-error : true
43+ uses : peter-evans/find-comment@v1
44+ id : find_comment
4245 with :
43- github-token : ${{ secrets.GITHUB_TOKEN }}
44- script : |
45- var fs = require('fs');
46- var issue_number = Number(fs.readFileSync('./NR'));
47- await github.issues.createComment({
48- owner: context.repo.owner,
49- repo: context.repo.repo,
50- issue_number: issue_number,
51- body: 'Everything is OK. Thank you for the PR!'
52- });
46+ token : ${{ secrets.GITHUB_TOKEN }}
47+ issue-number : ${{ github.event.number }} # ${{ steps.output_result.outputs.pull_request_number }}
48+ comment-author : ' github-actions[bot]'
49+
50+ - name : Create or update comment
51+ uses : peter-evans/create-or-update-comment@v1
52+ with :
53+ token : ${{ secrets.GITHUB_TOKEN }}
54+ issue-number : ${{ github.event.number }}
55+ # If the comment-id is blank, this will create a new comment.
56+ # Otherwise, it will update the comment.
57+ comment-id : ${{ steps.find_comment.outputs.comment-id }}
58+ body : |
59+ Create or update this comment.
60+ edit-mode : replace
61+ if : success()
62+
5363
0 commit comments