Skip to content

Shared actions available to both public and private repositories

License

Notifications You must be signed in to change notification settings

Kong/public-shared-actions

Repository files navigation

public-shared-actions

Shared actions available to both public and private repositories

Usage

- uses: Kong/public-shared-actions/<action-name>@<tag>

For example:

- uses:  Kong/public-shared-actions/code-build-actions/build-js-sdk@v1.6.0

Setting Up Lefthook for Commit Message Verification

This guide will help you install and configure Lefthook to enforce commit message standards locally.

Step 1: Install Lefthook

Lefthook is already listed within dev dependencies in the package.json file. Run pnpm install to install all the dependencies.

Platforms specfic installation of Lefthook

Refer to the official Lefthook installation guide for platform-specific instructions.


Step 4: Sync Lefthook Hooks

This repo should already contain a lefthook.yml configuration file in the root directory. The configuration in the lefthook.yml file enforces commit message linting using Commitlint. Package.json runs the below command as part of pnpm install to sync the Lefthook configuration with your Git hooks:

lefthook run pre-commit

Step 5: Verify Commit Message Linting

To verify that Lefthook is correctly set up:

  1. Stage a file for commit:

    git add .
  2. Attempt to commit with an invalid message:

    git commit -m "Test commitlint"

    You should see errors like:

    • ✖ subject may not be empty
    • ✖ type may not be empty
    • ✖ scope may not be empty
  3. Test with a valid commit message:

    git commit -m "feat(ci): test commitlint for scope"

    This should pass without any issues.


Additional Notes

  • Ensure that all developers in your team follow this setup to maintain consistent commit message standards.
  • Refer to the Lefthook Usage Guide for more advanced configurations and usage scenarios.

By setting up Lefthook, you ensure that all developers adhere to the commit message conventions..