1.0.1 • Published 3 years ago

actions-git v1.0.1

Weekly downloads
17
License
MIT
Repository
github
Last release
3 years ago

actions-git

Library for git related functions

Usage

headSHA()

The value of GITHUB_SHA cannot be relied on as always being the head SHA. For instance if the event triggering a build is of the type pull_request, then the GITHUB_SHA will point to the SHA of the merge commit not the head of the PR branch. This is the case even if actions/checkout is told to checkout the PR branch. This function calls out to git to get the actual head SHA.

import * as git from '@tradeshift/actions-git'

const sha = await git.headSHA()