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

4
dist/index.js vendored
View File

@@ -116,6 +116,7 @@ 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';
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
@@ -126,6 +127,9 @@ function run() {
core.exportVariable(GITHUB_EVENT_REF_SLUG, slug_1.slugref(eventData.ref));
core.exportVariable(GITHUB_EVENT_REF_SLUG_URL, slug_1.slugurlref(eventData.ref));
}
else if (eventData.hasOwnProperty('pull_request')) {
core.exportVariable(GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT, slug_1.shortsha(eventData.pull_request.head.sha));
}
}
exportSlug(GITHUB_REPOSITORY, GITHUB_REPOSITORY_SLUG);
exportSlugUrl(GITHUB_REPOSITORY, GITHUB_REPOSITORY_SLUG_URL);