A GitHub Action that checks for gitmoji prefixes in PR titles.
When a pull request is opened or updated, this action:
- Reads the PR title and checks it against allowed gitmoji prefixes from
pr-title-checker-config.json - If the title starts with a valid gitmoji (unicode or
:shortcode:), the check passes - If the title doesn't match, a "Gitmoji missing" label is added to the PR and the CI check fails
- If the PR has a label listed in
ignoreLabels, the check is skipped entirely
name: PR Title Gitmoji Check
on:
pull_request:
types: [opened, edited, labeled, unlabeled, synchronize]
jobs:
check-title:
runs-on: ubuntu-latest
steps:
- uses: your-org/pr-title-gitmoji-check@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}| Input | Description | Required | Default |
|---|---|---|---|
GITHUB_TOKEN |
GitHub token for API calls | No | github.token |
pass_on_octokit_error |
Force CI to pass if an API error occurs | No | false |
Edit pr-title-checker-config.json to customize:
LABEL— name and color of the failure label applied to PRsCHECKS.prefixes— allowed gitmoji prefixes (unicode and:shortcode:forms)CHECKS.ignoreLabels— PR labels that skip the title checkCHECKS.regexp/CHECKS.regexpFlags— optional regex pattern to match titlesCHECKS.alwaysPassCI— iftrue, logs the failure but doesn't fail the CI checkMESSAGES— custom success, failure, and notice messages
The action runs as a composite shell script. GitHub-hosted runners include jq and gh CLI out of the box — no build step or node_modules required.