Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GITHUB_HEAD_REF if available #27

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"package": "ncc build",
"package": "NODE_OPTIONS=--openssl-legacy-provider ncc build",
"test": "jest",
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
},
Expand Down Expand Up @@ -42,6 +42,6 @@
"jest-circus": "^24.9.0",
"prettier": "^1.19.1",
"ts-jest": "^24.2.0",
"typescript": "^3.7.5"
"typescript": "^4.6.3"
deeninetyone marked this conversation as resolved.
Show resolved Hide resolved
}
}
9 changes: 8 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ async function run(): Promise<void> {
info(`Previous version: ${previousVersion}`);
setOutput('previous-version', previousVersion);

await checkout(getEnv('GITHUB_REF'));
let checkoutRef;
try {
checkoutRef = getEnv('GITHUB_HEAD_REF') || getEnv('GITHUB_REF');
} catch {
checkoutRef = getEnv('GITHUB_REF');
}
deeninetyone marked this conversation as resolved.
Show resolved Hide resolved

await checkout(checkoutRef);

let currentVersion = await determineVersion();

Expand Down
Loading