Set a specific length for shortened commit SHA values instead of letting Git determine it automatically.
steps:
- name: Inject enhanced GitHub environment variables
uses: rlespinasse/github-slug-action@v5
with:
short-length: 7| 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 |
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@v5Without a checkout step, the action falls back to the effective value of the core.abbrev Git configuration variable, or 7 if unavailable.
- Inputs reference for the full specification
- SHORT transformation for how short values are computed