1

For a lookup I need the short sha of a Commit in mulitple steps in GitHub Actions.

So I tried:

- env:
    SHORT_SHA: ${{ format('{0}{1}{2}{3}{4}{5}{6}', github.sha[0], github.sha[1], github.sha[2], github.sha[3], github.sha[4], github.sha[5], github.sha[6]) }}
  steps:

but the resulting string is empty. Now I am out of ideas with which GitHub expression I can build a short sha.

abergmeier
  • 13,224
  • 13
  • 64
  • 120
  • Can you compute it during the commands in `run`? If so, use `git rev-parse --short HEAD`. If not, there's a couple of different techniques here: https://stackoverflow.com/questions/59810838/how-to-get-the-short-sha-for-the-github-workflow. – Ed Kloczko Oct 31 '22 at 00:54

0 Answers0