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

verify build provenance #1845

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
- "main"
workflow_dispatch:

permissions:
contents: read

jobs:
test-linux:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -42,6 +45,8 @@ jobs:
- run: npm run build
- run: npm run package
- run: npm test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: setup-perl
name: use the action
Expand Down Expand Up @@ -121,6 +126,8 @@ jobs:
- run: npm run build
- run: npm run package
- run: npm test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: setup-perl
name: use the action
Expand Down Expand Up @@ -203,6 +210,8 @@ jobs:
- run: npm run build
- run: npm run package
- run: npm test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: setup-perl
name: use the action
Expand Down
11 changes: 6 additions & 5 deletions __test__/installer.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import io = require("@actions/io");
import path = require("path");
import os = require("os");
import fs = require("fs");
import * as io from "@actions/io";
import * as path from "path";
import * as os from "os";
import * as fs from "fs";

const githubToken = process.env["GITHUB_TOKEN"];
const toolDir = path.join(__dirname, "runner", "tools");
const tempDir = path.join(__dirname, "runner", "temp");
// const dataDir = path.join(__dirname, 'data');
Expand Down Expand Up @@ -30,7 +31,7 @@ describe("installer tests", () => {
}, 100000);

it("Acquires version of Perl if no matching version is installed", async () => {
await installer.getPerl("5.26.x", false);
await installer.getPerl("5.26.x", false, githubToken);
const perlDir = path.join(toolDir, "perl", "5.26.3", os.arch());

expect(fs.existsSync(`${perlDir}.complete`)).toBe(true);
Expand Down
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ inputs:
description: working directory.
default: "."
required: false
github-token:
description: |
GitHub token to use for verifying Perl binary.
default: "${{ github.token }}"
required: false
outputs:
perl-version:
description: |
Expand All @@ -55,11 +60,11 @@ outputs:
It contains useful information to use as the cache key,
e.g. the platform, the version of perl, the compiler option for building perl.
cache-hit:
description: 'A boolean value to indicate if a cache was hit'
description: "A boolean value to indicate if a cache was hit"
runs:
using: "node20"
main: "dist/setup/index.js"
post: 'dist/cache-save/index.js'
post: "dist/cache-save/index.js"
post-if: success()
branding:
icon: "play"
Expand Down
Loading