2023-04-04 12:44:24 +09:00
|
|
|
name: Test v3
|
|
|
|
on: workflow_dispatch
|
|
|
|
jobs:
|
|
|
|
testCreateOrUpdateComment:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-04-04 12:50:50 +09:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2023-04-04 12:44:24 +09:00
|
|
|
# Test create
|
|
|
|
- name: Create comment
|
2023-05-03 05:58:14 +00:00
|
|
|
uses: peter-evans/create-or-update-comment@v3
|
2023-04-04 12:44:24 +09:00
|
|
|
id: couc
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
|
|
|
issue-number: 1
|
|
|
|
body: |
|
|
|
|
This is a multi-line test comment
|
|
|
|
- With GitHub **Markdown** :sparkles:
|
|
|
|
- Created by [create-or-update-comment][1]
|
|
|
|
|
|
|
|
[1]: https://github.com/peter-evans/create-or-update-comment
|
|
|
|
reactions: '+1'
|
|
|
|
|
|
|
|
# Test update
|
|
|
|
- name: Update comment
|
2023-05-03 05:58:14 +00:00
|
|
|
uses: peter-evans/create-or-update-comment@v3
|
2023-04-04 12:44:24 +09:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
|
|
|
comment-id: ${{ steps.couc.outputs.comment-id }}
|
|
|
|
body: |
|
|
|
|
**Edit:** Some additional info
|
|
|
|
reactions: eyes
|
|
|
|
reactions-edit-mode: replace
|
|
|
|
|
|
|
|
# Test add reactions
|
|
|
|
- name: Add reactions
|
2023-05-03 05:58:14 +00:00
|
|
|
uses: peter-evans/create-or-update-comment@v3
|
2023-04-04 12:44:24 +09:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
|
|
|
comment-id: ${{ steps.couc.outputs.comment-id }}
|
|
|
|
reactions: heart, hooray, laugh
|
|
|
|
|
|
|
|
# Test create with body from file
|
|
|
|
- name: Create comment
|
2023-05-03 05:58:14 +00:00
|
|
|
uses: peter-evans/create-or-update-comment@v3
|
2023-04-04 12:44:24 +09:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
|
|
|
issue-number: 1
|
|
|
|
body-file: .github/comment-body.md
|
|
|
|
|
|
|
|
# Test create from template
|
|
|
|
- name: Render template
|
|
|
|
id: template
|
2023-05-17 05:57:50 +00:00
|
|
|
uses: chuhlomin/render-template@v1.7
|
2023-04-04 12:44:24 +09:00
|
|
|
with:
|
|
|
|
template: .github/comment-template.md
|
|
|
|
vars: |
|
|
|
|
foo: this
|
|
|
|
bar: that
|
|
|
|
|
|
|
|
- name: Create comment
|
2023-05-03 05:58:14 +00:00
|
|
|
uses: peter-evans/create-or-update-comment@v3
|
2023-04-04 12:44:24 +09:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
|
|
|
issue-number: 1
|
|
|
|
body: ${{ steps.template.outputs.result }}
|