github-desktop/script/build-platforms.ts

15 lines
403 B
TypeScript
Raw Normal View History

export function getSha() {
2020-07-09 12:08:49 +00:00
const gitHubSha = process.env.GITHUB_SHA
if (isGitHubActions() && gitHubSha !== undefined && gitHubSha.length > 0) {
2020-07-22 16:35:09 +00:00
return gitHubSha
2020-07-09 12:08:49 +00:00
}
throw new Error(
`Unable to get the SHA for the current platform. Check the documentation for the expected environment variables.`
)
}
2020-07-09 12:08:49 +00:00
export function isGitHubActions() {
return process.env.GITHUB_ACTIONS === 'true'
}