check-pr-commits-authors-action

Checks a pull request commits authors according to the email domain. It pass if it's not triggered on a pull request event.

Inputs

EMAIL_PATTERN

Required email pattern. For example: "^.*@required\.com$".

IGNORED_EMAIL_PATTERN

Email pattern to be ignored on check.. For example: "^.*@ignored\.com$".

Env

GITHUB_TOKEN

Required github token to read the repository pull request.

Usage example

name: Check PR commits authors example

on:
  pull_request:

jobs:
  check-commits-authors:
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: profusion/check-pr-commits-authors-action@main
        with:
          EMAIL_PATTERN: ${{ vars.EMAIL_PATTERN }}
          IGNORED_EMAIL_PATTERN: ${{ vars.IGNORED_EMAIL_PATTERN }} # this one is not required

Running example

Triggered on a no pull request related event

Screenshot 2023-04-19 at 13 48 42

At least one invalid commit author

Screenshot 2023-04-19 at 12 38 07

No invalid commit author

Screenshot 2023-04-19 at 12 46 17