Skip to content

Overview ​

The GitWit Action allows you to run GitWit directly on GitHub Actions, enabling you to validate commit messages and generate changelogs automatically during workflow execution.

The action runs GitWit within a Docker container, ensuring a consistent environment and can be used in any GitHub Actions-enabled pipeline.

Currently, the action supports two main commands:

  • lint - validates commit messages according to the rules defined in the project;
  • changelog - generates a changelog from the commit history.

Basic example ​

yaml
name: GitWit CI

on:
  pull_request:
    branches:
      - main

jobs:
  gitwit:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - name: Run GitWit Lint
        uses: rafandoo/gitwit-action@v1
        with:
          command: lint

⚠️ Warning:

fetch-depth: 0 is required for GitWit to have access to the full history of commits and be able to perform validation correctly.

Inputs ​

InputDescriptionRequiredDefault
commandDefine which GitWit command will be executed (lint or changelog)✔-
changelog_stdoutSends the generated changelog to the default output (stdout) instead of saving it in a file.✖false
changelog_from_latest_releaseGenerates the changelog only from commits since the latest release instead of all commits.✖false
argsAdditional arguments passed directly to the command of GitWit.✖-

Outputs ​

OutputDescription
changelogGenerated changelog content (available only when changelog_stdout=true)

When to use ​

Use GitWit Action to:

  • validate commit messages in Pull Requests;
  • generate changelogs automatically during CI;
  • automate the creation of GitHub Releases;
  • maintain a consistent and standardized history of changes.

Released under the Apache License.