Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.56 KB

File metadata and controls

45 lines (34 loc) · 1.56 KB

Configure the length of short SHA values

Set a specific length for shortened commit SHA values instead of letting Git determine it automatically.

Usage

steps:
  - name: Inject enhanced GitHub environment variables
    uses: rlespinasse/github-slug-action@v5
    with:
      short-length: 7

Common values

Value Use case
(empty) Let Git decide based on repository size (default)
7 Common "small repository" length
8 Reproduce v3 action behaviour
4 Minimum allowed length

Letting Git decide (default)

When short-length is left empty, the action uses Git's git rev-parse --short behaviour. The length depends on the size of your repository and may change over time as the repository grows.

Warning

If you leave short-length empty, you need to checkout the source first so Git can determine the length:

steps:
  - uses: actions/checkout@v6
  - uses: rlespinasse/github-slug-action@v5

Without a checkout step, the action falls back to the effective value of the core.abbrev Git configuration variable, or 7 if unavailable.

See also