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

feature: add support for commit input (fixes #1634) #1858

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
builds updates dist
Signed-off-by: James Bradlee <james.bradlee@telenor.no>
testersen committed Aug 20, 2024
commit 1be0f9404cf8618e25c4809482076d6ebe47e318
7 changes: 6 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
@@ -1717,6 +1717,7 @@ const path = __importStar(__nccwpck_require__(1017));
const workflowContextHelper = __importStar(__nccwpck_require__(9568));
function getInputs() {
return __awaiter(this, void 0, void 0, function* () {
var _a;
const result = {};
// GitHub workspace
let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
@@ -1748,7 +1749,11 @@ function getInputs() {
const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
`${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
// Source branch, source version
result.ref = core.getInput('ref');
result.commit = core.getInput('commit');
if (result.commit && !result.commit.match(/^[0-9a-fA-F]{40}$/)) {
throw new Error(`The commit SHA '${result.commit}' is not a valid SHA.`);
}
result.ref = (_a = core.getInput('ref')) !== null && _a !== void 0 ? _a : result.commit;
if (!result.ref) {
if (isWorkflowRepository) {
result.ref = github.context.ref;