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
in input-helper, add validation to commit input
Signed-off-by: James Bradlee <james.bradlee@telenor.no>
  • Loading branch information
testersen committed Aug 20, 2024
commit 267ca9cee142ee19093ffc70c239c68e63e54ab2
4 changes: 4 additions & 0 deletions src/input-helper.ts
Original file line number Diff line number Diff line change
@@ -58,6 +58,10 @@ export async function getInputs(): Promise<IGitSourceSettings> {

// Source branch, source version
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 = core.getInput('ref') ?? result.commit
if (!result.ref) {
if (isWorkflowRepository) {