Skip to content
git-commit

GitHub Action

Get Short SHA

v1 Latest version

Get Short SHA

git-commit

Get Short SHA

Quickly get the Short SHA-1 in your workflow

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Get Short SHA

uses: hudsonm62/short-sha@v1

Learn more about this action in hudsonm62/short-sha

Choose a version

Get Short SHA Action

A dead-simple GitHub Action to quickly get the Short SHA in your workflow.

GitHub Issues or Pull Requests CI Lint License Code Style

Usage

name: Example Workflow
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - id: short-sha
        uses: hudsonm62/short-sha@v1
      - run: echo "${{ steps.short-sha.outputs.sha }}"

Inputs

Input Default Description
commit-sha ${{ github.sha }} Full length, 40 character SHA-1
length 7 Length of the SHA to cut

Outputs

Output Description
sha The short SHA