mirror of
https://github.com/desktop/desktop
synced 2024-10-31 05:19:03 +00:00
889bae6c78
Reusable build workflow
14 lines
403 B
TypeScript
14 lines
403 B
TypeScript
export function getSha() {
|
|
const gitHubSha = process.env.GITHUB_SHA
|
|
if (isGitHubActions() && gitHubSha !== undefined && gitHubSha.length > 0) {
|
|
return gitHubSha
|
|
}
|
|
|
|
throw new Error(
|
|
`Unable to get the SHA for the current platform. Check the documentation for the expected environment variables.`
|
|
)
|
|
}
|
|
|
|
export function isGitHubActions() {
|
|
return process.env.GITHUB_ACTIONS === 'true'
|
|
}
|