Skip to content

Commit

Permalink
feat: Switching to @actions/io package (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
IAreKyleW00t authored Sep 9, 2024
1 parent ca0d871 commit aa17d07
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 203 deletions.
158 changes: 4 additions & 154 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions dist/licenses.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 15 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/tool-cache": "^2.0.1",
"lookpath": "^1.2.2"
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
Expand Down
9 changes: 5 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import * as core from '@actions/core'
import * as exec from '@actions/exec'
import * as github from '@actions/github'
import * as tc from '@actions/tool-cache'
import * as exec from '@actions/exec'
import * as io from '@actions/io'

import * as path from 'path'
import * as fs from 'fs'
import * as os from 'os'

import { lookpath } from 'lookpath'
import * as utils from './utils'

export const CRANE_REPO = 'https://github.com/google/go-containerregistry'
Expand Down Expand Up @@ -71,7 +72,7 @@ export async function run(): Promise<void> {
)

// Verify crane if slsa-verifier is in the PATH (unless told to skip)
const slsa = await lookpath('slsa-verifier')
const slsa = await io.which('slsa-verifier')
if (core.getBooleanInput('verify') && slsa) {
// Download release attestation into tmpDir
core.info('🔏 Downloading attestation')
Expand Down Expand Up @@ -129,6 +130,6 @@ export async function run(): Promise<void> {
// Cleanup tmpDir if it was created at any point
if (tmpDir) {
core.debug(`Deleting ${tmpDir}`)
fs.rmSync(tmpDir, { recursive: true, force: true })
await io.rmRF(tmpDir)
}
}

0 comments on commit aa17d07

Please sign in to comment.