Skip to content

Commit

Permalink
fix: Abbreviate commit_sha to be the short SHA (actions#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenverCoder1 authored Apr 28, 2023
1 parent 744db5a commit db30269
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,8 @@ core.info(`Running in ${baseDir}`)
.then(async (data) => {
log(undefined, data)
setOutput('committed', 'true')
setOutput('commit_sha', data.commit)
await git
.revparse(data.commit)
.then((long_sha) => setOutput('commit_long_sha', long_sha))
.catch((err) => core.warning(`Couldn't parse long SHA:\n${err}`))
setOutput('commit_long_sha', data.commit)
setOutput('commit_sha', data.commit.substring(0, 7))
})
.catch((err) => core.setFailed(err))

Expand Down

0 comments on commit db30269

Please sign in to comment.