Skip to content

Commit

Permalink
feat: Add env variable to facilitate CI tests of Action installer (#393)
Browse files Browse the repository at this point in the history
* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

Signed-off-by: laurentsimon <laurentsimon@google.com>
  • Loading branch information
laurentsimon authored Dec 6, 2022
1 parent 477ac0d commit 4cba39a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 6 additions & 3 deletions actions/installer/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ function cleanup() {
}
function run() {
return __awaiter(this, void 0, void 0, function* () {
// Get requested verifier version and validate.
// See https://docs.github.com/en/actions/learn-github-actions/contexts#github-context.
const actionRef = process.env.GITHUB_ACTION_REF || "";
// Get requested verifier version and validate
// SLSA_VERIFIER_CI_ACTION_REF is a utility env variable to help us test
// the Action in CI.
const actionRef = process.env.GITHUB_ACTION_REF ||
process.env.SLSA_VERIFIER_CI_ACTION_REF ||
"";
let version;
try {
version = yield getVerifierVersion(actionRef);
Expand Down
2 changes: 1 addition & 1 deletion actions/installer/dist/index.js.map

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions actions/installer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ async function cleanup(): Promise<void> {
}

async function run(): Promise<void> {
// Get requested verifier version and validate.
// See https://docs.github.com/en/actions/learn-github-actions/contexts#github-context.
const actionRef = process.env.GITHUB_ACTION_REF || "";
// Get requested verifier version and validate
// SLSA_VERIFIER_CI_ACTION_REF is a utility env variable to help us test
// the Action in CI.
const actionRef =
process.env.GITHUB_ACTION_REF ||
process.env.SLSA_VERIFIER_CI_ACTION_REF ||
"";
let version: string;
try {
version = await getVerifierVersion(actionRef);
Expand Down

0 comments on commit 4cba39a

Please sign in to comment.