Skip to content

kitsuyui/happy-commit

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

happy-commit

codecov

  • GitHub Action to celebrate your commits on PR.

Example

happy-commit

Conditions

  • Celebrate when issue number reaches 10, 100, 1000, ... etc.
  • Celebrate when issue number is lucky number (e.g. 7, 77, 777, ... etc.)
  • Celebrate when commit id contains lucky number (e.g. 7, 77, 777, ... etc.)
  • Celebrate when commit id is a sequence of digits (e.g. 123, 1234, ... etc.)
  • Celebrate when commit id is a hexspeaking number (e.g. deadbeef, cafe, c0ffee, ... etc.)
  • Notify when issue number is unlucky number (e.g. 666, ... etc.)

c.f. https://github.com/kitsuyui/happy-commit/blob/main/src/rules.ts

Example usage

name: happy-commit
on:
  - pull_request

permissions:
  contents: read
  pull-requests: write
  issues: write

jobs:
  happy:
    runs-on: ubuntu-latest
    name: happy
    steps:
      - uses: kitsuyui/happy-commit
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Additional patterns

custom patterns can be added by additional_rules. For example, you can celebrate when commit id contains 1.

      - name: happy-commit
        uses: kitsuyui/happy-commit
        continue-on-error: true
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          additional_rules: |
            [
              {
                "kind": "commit",
                "rule": "(?:1)",
                "message": "custom message! `{{commitId}}` is lucky! It contains **{{matched}}"
              }
            ]

License

MIT