Skip to content
award

GitHub Action

happy-commit

v0.9 Latest version

happy-commit

award

happy-commit

Celebrate pull-request when it contains a lucky commit

Installation

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

              

- name: happy-commit

uses: kitsuyui/[email protected]

Learn more about this action in kitsuyui/happy-commit

Choose a version

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