Skip to content

Commit 4cba39a

Browse files
authored
feat: Add env variable to facilitate CI tests of Action installer (#393)
* update Signed-off-by: laurentsimon <[email protected]> * update Signed-off-by: laurentsimon <[email protected]> * update Signed-off-by: laurentsimon <[email protected]> Signed-off-by: laurentsimon <[email protected]>
1 parent 477ac0d commit 4cba39a

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

actions/installer/dist/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,12 @@ function cleanup() {
119119
}
120120
function run() {
121121
return __awaiter(this, void 0, void 0, function* () {
122-
// Get requested verifier version and validate.
123-
// See https://docs.github.com/en/actions/learn-github-actions/contexts#github-context.
124-
const actionRef = process.env.GITHUB_ACTION_REF || "";
122+
// Get requested verifier version and validate
123+
// SLSA_VERIFIER_CI_ACTION_REF is a utility env variable to help us test
124+
// the Action in CI.
125+
const actionRef = process.env.GITHUB_ACTION_REF ||
126+
process.env.SLSA_VERIFIER_CI_ACTION_REF ||
127+
"";
125128
let version;
126129
try {
127130
version = yield getVerifierVersion(actionRef);

actions/installer/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

actions/installer/src/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ async function cleanup(): Promise<void> {
8787
}
8888

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

0 commit comments

Comments
 (0)