5c591f7f55
- id, body, html_url
66 lines
No EOL
1.8 KiB
YAML
66 lines
No EOL
1.8 KiB
YAML
on: pull_request
|
|
|
|
jobs:
|
|
test_comment_pr:
|
|
name: (NRT) Comment PR
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: (BEFORE) Setup test cases
|
|
run: echo '**Content of file referenced with absolute path**' > /tmp/foobar.txt
|
|
|
|
- name: Comment PR with message
|
|
uses: ./
|
|
id: nrt_message
|
|
with:
|
|
message: |
|
|
Current branch is `${{ github.head_ref }}`.
|
|
_(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
|
|
comment_tag: nrt_message
|
|
reactions: eyes, rocket
|
|
mode: recreate
|
|
|
|
- name: Comment PR with message that will be deleted
|
|
uses: ./
|
|
with:
|
|
message: |
|
|
This PR is being built...
|
|
comment_tag: nrt_message_delete
|
|
reactions: eyes
|
|
mode: delete
|
|
|
|
- name: Comment PR with file
|
|
uses: ./
|
|
with:
|
|
filePath: README.md
|
|
comment_tag: nrt_file
|
|
reactions: eyes, rocket
|
|
mode: recreate
|
|
|
|
- name: Comment PR with file (absolute path)
|
|
uses: ./
|
|
with:
|
|
filePath: /tmp/foobar.txt
|
|
comment_tag: nrt_file_absolute
|
|
reactions: eyes, rocket
|
|
mode: recreate
|
|
|
|
- name: Do not comment PR if not exists
|
|
uses: ./
|
|
with:
|
|
message: Should not be printed
|
|
comment_tag: nrt_create_if_not_exists
|
|
create_if_not_exists: false
|
|
|
|
- name: Check outputs
|
|
run: |
|
|
echo "id : ${{ steps.nrt_message.outputs.id }}"
|
|
echo "body : ${{ steps.nrt_message.outputs.body }}"
|
|
echo "html_url : ${{ steps.nrt_message.outputs.html_url }}"
|
|
|
|
- name: (AFTER) Setup test cases
|
|
run: rm /tmp/foobar.txt |