Skip to content
shield

GitHub Action

Required Checks

v1.0.0 Latest version

Required Checks

shield

Required Checks

Define required checks inside your repository

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Required Checks

uses: RoryQ/[email protected]

Learn more about this action in RoryQ/required-checks

Choose a version

Required Checks

Define required checks inside your repository

Features

  • Fail if any configured checks fail
  • Fail if a configured check fails to report
  • Define check name patterns using regular expressions

Configuration

on:
  pull_request:

name: Required Checks
jobs:
  required-checks:
    runs-on: ubuntu-latest
    steps:
    - name: Wait for required checks
      uses: roryq/required-checks@master
      with:
        # required-workflow-patterns is a yaml list of regex patterns to check
        required-workflow-patterns: |
          # will match any check with tests in its name
          - tests
          # will match either markdown-lint or yaml-lint
          - (markdown-lint|yaml-lint)
          
        # GitHub token
        token: ${{ secrets.GITHUB_TOKEN }}
        # number of seconds to wait before starting the first poll
        initial-delay-seconds: 15
        # number of seconds to wait between polls
        poll-frequency-seconds: 30
        # number of times to retry if a required check is missing. 
        # This is useful in cases where the workflow is still being created.
        missing-required-retry-count: 3
        # target sha that the checks have been run against. Defaults to ${{ github.event.pull_request.head.sha || github.sha }}
        target-sha: ${{ github.event.pull_request.head.sha || github.sha }}