mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-05-17 10:25:08 +00:00
1.6 KiB
1.6 KiB
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-lengthempty, you need to checkout the source first so Git can determine the length:steps: - uses: actions/checkout@v6 - uses: rlespinasse/github-slug-action@v5Without a checkout step, the action falls back to the effective value of the
core.abbrevGit configuration variable, or7if unavailable.
See also
- Inputs reference for the full specification
- SHORT transformation for how short values are computed