@tradeshift/actions-git
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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()

Readme

Keywords

none

Package Sidebar

Install

npm i @tradeshift/actions-git

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.13 kB

Total Files

5

Last publish

Collaborators

  • jesperterkelsen
  • ngunder
  • tradeshift-larsbojensen
  • wejendorp
  • kian-esmailpour
  • tradeshift-ci
  • aleksandr.elkin
  • ehats
  • tradeshift-public