Skip to content

MeilCli/hidable-comment-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

hidable-comment-action

CI-Master
Create, update or delete comment by action argument

Example

Check issue title

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@v2
        with:
          number: ${{ github.event.issue.number }}
          show: ${{ steps.regex.outputs.matched == 'false' }}
          id: 'title-lint'
          body: |
            title lint example body
            - test1
            - test2
            - test3

You can also pin to a specific release version in the format @v2.x.x

Check Pull Request title

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@v2
        with:
          number: ${{ github.event.pull_request.number }}
          show: ${{ steps.regex.outputs.matched == 'false' }}
          id: 'title-lint'
          body: |
            title lint example body
            - test1
            - test2
            - test3

Input

  • 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 }}
  • 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 or false
    • if set the true, add or update comment. if set the false, delete comment
  • body
    • required
    • comment body

Contributes

Could you want to contribute?

see Contributing.md

License

Using