Add commit_sha output (#275)

* feat: add commit_sha output

* docs(README): add docs for commit_sha
This commit is contained in:
Federico Grandi
2021-08-24 12:10:46 +02:00
committed by GitHub
parent c5fa67606e
commit 5c82f36c45
5 changed files with 14 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
import * as core from '@actions/core'
import path from 'path'
import simpleGit, { Response } from 'simple-git'
import simpleGit, { CommitSummary, Response } from 'simple-git'
import YAML from 'js-yaml'
import {
getInput,
@@ -85,8 +85,11 @@ core.info(`Running in ${baseDir}`)
}
: {})
},
(err, data?) => {
if (data) setOutput('committed', 'true')
(err, data?: CommitSummary) => {
if (data) {
setOutput('committed', 'true')
setOutput('commit_sha', data.commit)
}
return log(err, data)
}
)