feat: expose GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT

This commit is contained in:
Julien Klaer
2021-01-12 10:22:14 +01:00
committed by GitHub
parent 5629d21ee9
commit 5b9fe6015d
6 changed files with 43 additions and 15 deletions

View File

@@ -26,6 +26,8 @@ const GITHUB_BASE_REF_SLUG_URL = 'GITHUB_BASE_REF_SLUG_URL'
const GITHUB_SHA_SHORT = 'GITHUB_SHA_SHORT'
const GITHUB_EVENT_REF_SLUG = 'GITHUB_EVENT_REF_SLUG'
const GITHUB_EVENT_REF_SLUG_URL = 'GITHUB_EVENT_REF_SLUG_URL'
const GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT =
'GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT'
async function run(): Promise<void> {
try {
@@ -38,6 +40,11 @@ async function run(): Promise<void> {
GITHUB_EVENT_REF_SLUG_URL,
slugurlref(eventData.ref)
)
} else if (eventData.hasOwnProperty('pull_request')) {
core.exportVariable(
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT,
shortsha(eventData.pull_request.head.sha)
)
}
}