Create, update or delete comment by action argument
Features:
- Sticky comment
- This action upsert comment.
- Conditional comment
- This action can hide comment by action argument.
- Multiple comment type support
- You can set multiple sticky comment by using
id
.
- You can set multiple sticky comment by using
- Comment body from file
- You can set comment body from file.
- Enterprise server support
- You can use this action in enterprise server.
name: 'Example: Sticky Comment Body'
on:
pull_request:
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: MeilCli/hidable-comment-action@v3
with:
number: ${{ github.event.pull_request.number }}
show: true
id: 'example-sticky-comment-body'
body: 'your comment body'
You can also pin to a specific release version in the format @v2.x.x
And, you can use body_path
to read comment body from file.
name: 'Example: Sticky Comment Body Path'
on:
pull_request:
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: MeilCli/hidable-comment-action@v3
with:
number: ${{ github.event.pull_request.number }}
show: true
id: 'example-sticky-comment-body-path'
body_path: 'file_path_to_your_comment_body'
name: 'Check-Issue-Title'
on:
issues:
types: [opened, edited, reopened]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: MeilCli/regex-match@v2
id: regex
with:
regex_pattern: 'test: .*'
regex_option: 'g'
search_string: ${{ github.event.issue.title }}
- uses: MeilCli/hidable-comment-action@v3
with:
number: ${{ github.event.issue.number }}
show: ${{ steps.regex.outputs.matched == 'false' }}
id: 'title-lint'
body: |
title lint example body
- test1
- test2
- test3
name: 'Check-Pull-Request-Title'
on:
pull_request:
types: [opened, edited, reopened]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: MeilCli/regex-match@v2
id: regex
with:
regex_pattern: 'test: .*'
regex_option: 'g'
search_string: ${{ github.event.pull_request.title }}
- uses: MeilCli/hidable-comment-action@v3
with:
number: ${{ github.event.pull_request.number }}
show: ${{ steps.regex.outputs.matched == 'false' }}
id: 'title-lint'
body: |
title lint example body
- test1
- test2
- test3
github_token
- required
- github token, using to read repository
- default:
${{ github.token }}
repository
- required
- executed repository name
- for example: MeilCli/hidable-comment-action
- default:
${{ github.repository }}
graphql_url
- required
- github graphql api url
- default:
${{ github.graphql_url }}
number
- required
- issue or pull request number
id
- required
- Id for identify multiple hidable-comment-action in same issue or repository
- default:
hidable-comment
show
- required
- value:
true
orfalse
- if set the true, add or update comment. if set the false, delete comment
body
- required, eigher body or body_path
- comment body
body_path
- required, eigher body or body_path
- comment body path, if set, read body from file
replace_mode
- required
- value:
always
,changed
orignore
- default:
ignore
- This option is used to determine whether to update the comment when the comment id is the same as the existing comment.
- details:
always
: always update commentchanged
: update comment only when the body is different from the existing commentignore
: do not update comment. This value is useful for checklist style comment.
see Contributing.md
- actions/toolkit, published by MIT License
- apollo-client, published by MIT License
- cross-fetch, published by MIT License
- graphql, published by MIT License