Skip to content

a github action to block prs from merging, and to display a message

License

Notifications You must be signed in to change notification settings

biocatchltd/gh-actions-block-with-comment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

block-with-comment

a github action to add a comment if a test fails, blocking a PR, or remove it if it succeeds.

Example

An example workflow that uses this action to check for new tags and release a new version if it is new:

name: test pr
on:
  pull_request:
    types: [opened, reopened, edited, synchronize]
    branches:
      - main

jobs:
    do-test:
        name: check that the pr's name begins with "test"
        runs-on: ubuntu-latest

        steps:
            - name: checkout
              uses: actions/checkout@v2

            - name: block with comment
              uses: biocatchltd/gh-actions-block-with-comment@v1
              with:
                  comment: "This PR's name must begin with 'test'"
                  test: ${{ startsWith(github.event.pull_request.title, 'test') }}

inputs

  • test: The test to perform, eill only pass if the test is 'true'
  • fail_message: The message to post if the test fails
  • comment_tag: The tag to use to identify the comment

Note

this action will fail if the test is not 'true', and no further steps will be executed.

About

a github action to block prs from merging, and to display a message

Resources

License

Stars

Watchers

Forks

Packages

No packages published