From fb613f3966b90de537239fddeadac4d9c600fd04 Mon Sep 17 00:00:00 2001 From: nobuhikosawai Date: Fri, 22 Sep 2023 17:08:31 -0700 Subject: [PATCH] enable to override commit sha on github action --- action-src/main.ts | 3 ++- action.yml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/action-src/main.ts b/action-src/main.ts index 0940e34a8..1bb88d904 100755 --- a/action-src/main.ts +++ b/action-src/main.ts @@ -93,6 +93,7 @@ async function run() { const autoAcceptChanges = getInput('autoAcceptChanges'); const branchName = getInput('branchName'); const buildScriptName = getInput('buildScriptName'); + const commitSha = getInput('commitSha'); const debug = getInput('debug'); const diagnostics = getInput('diagnostics'); const dryRun = getInput('dryRun'); @@ -120,7 +121,7 @@ async function run() { const junitReport = getInput('junitReport'); process.env.CHROMATIC_ACTION = 'true'; - process.env.CHROMATIC_SHA = sha; + process.env.CHROMATIC_SHA = commitSha || sha; process.env.CHROMATIC_BRANCH = branchName || branch; process.env.CHROMATIC_SLUG = repositorySlug || slug; if (mergeCommit) { diff --git a/action.yml b/action.yml index ea50b29d0..cc4189899 100755 --- a/action.yml +++ b/action.yml @@ -21,6 +21,9 @@ inputs: buildScriptName: description: 'The npm script that builds your Storybook [build-storybook]' required: false + commitSha: + description: 'Override the commit SHA' + required: false debug: description: 'Output verbose debugging information' required: false