Skip to content

Commit

Permalink
Fix CI_PR_SHA.
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzDiebold committed Jul 17, 2022
1 parent 72510ef commit 0f5d8f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dist/index.js
Expand Up @@ -192,7 +192,7 @@ try {
const pullRequest = github.context.payload &&
github.context.payload.pull_request;
if (pullRequest) {
const prSha = github.event.pull_request.head.sha;
const prSha = pullRequest.head.sha;
core.exportVariable('CI_PR_SHA_SHORT', getShaShort(prSha));
core.info(`Set CI_PR_SHA_SHORT=${process.env.CI_PR_SHA_SHORT}`);

Expand All @@ -215,7 +215,8 @@ try {
core.info(`Set CI_PR_DESCRIPTION=${process.env.CI_PR_DESCRIPTION}`);
} else {
core.info('No pull request. ' +
'Cannot set "CI_PR_TITLE" and "CI_PR_DESCRIPTION".');
'Cannot set "CI_PR_SHA_SHORT", "CI_PR_SHA", "CI_PR_NUMBER", ' +
'"CI_PR_ID", "CI_PR_TITLE" and "CI_PR_DESCRIPTION".');
}

const actor = process.env.GITHUB_ACTOR;
Expand Down
5 changes: 3 additions & 2 deletions index.js
Expand Up @@ -186,7 +186,7 @@ try {
const pullRequest = github.context.payload &&
github.context.payload.pull_request;
if (pullRequest) {
const prSha = github.event.pull_request.head.sha;
const prSha = pullRequest.head.sha;
core.exportVariable('CI_PR_SHA_SHORT', getShaShort(prSha));
core.info(`Set CI_PR_SHA_SHORT=${process.env.CI_PR_SHA_SHORT}`);

Expand All @@ -209,7 +209,8 @@ try {
core.info(`Set CI_PR_DESCRIPTION=${process.env.CI_PR_DESCRIPTION}`);
} else {
core.info('No pull request. ' +
'Cannot set "CI_PR_TITLE" and "CI_PR_DESCRIPTION".');
'Cannot set "CI_PR_SHA_SHORT", "CI_PR_SHA", "CI_PR_NUMBER", ' +
'"CI_PR_ID", "CI_PR_TITLE" and "CI_PR_DESCRIPTION".');
}

const actor = process.env.GITHUB_ACTOR;
Expand Down

0 comments on commit 0f5d8f2

Please sign in to comment.