|
12 | 12 | description: "Registry authentication details as YAML objects" |
13 | 13 | required: false |
14 | 14 |
|
| 15 | +env: |
| 16 | + DOCKER_ACTIONS_TOOLKIT_MODULE: "@docker/[email protected]" |
| 17 | + |
15 | 18 | jobs: |
16 | 19 | verify: |
17 | 20 | runs-on: ubuntu-24.04 |
@@ -44,12 +47,37 @@ jobs: |
44 | 47 | core.setOutput('artifact-name', artifactName); |
45 | 48 | core.setOutput('output-type', outputType); |
46 | 49 | core.setOutput('signed', signed); |
| 50 | + - |
| 51 | + name: Install @docker/actions-toolkit |
| 52 | + if: ${{ steps.vars.outputs.signed == 'true' }} |
| 53 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 |
| 54 | + env: |
| 55 | + INPUT_DAT-MODULE: ${{ env.DOCKER_ACTIONS_TOOLKIT_MODULE }} |
| 56 | + with: |
| 57 | + script: | |
| 58 | + await exec.exec('npm', ['install', '--prefer-offline', '--ignore-scripts', core.getInput('dat-module')]); |
47 | 59 | - |
48 | 60 | name: Install Cosign |
49 | 61 | if: ${{ steps.vars.outputs.signed == 'true' }} |
50 | | - uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0 |
| 62 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 |
| 63 | + env: |
| 64 | + INPUT_COSIGN-VERSION: ${{ steps.vars.outputs.cosign-version }} |
51 | 65 | with: |
52 | | - cosign-release: ${{ steps.vars.outputs.cosign-version }} |
| 66 | + script: | |
| 67 | + const { Cosign } = require('@docker/actions-toolkit/lib/cosign/cosign'); |
| 68 | + const { Install } = require('@docker/actions-toolkit/lib/cosign/install'); |
| 69 | +
|
| 70 | + const cosignInstall = new Install(); |
| 71 | + const cosignBinPath = await cosignInstall.download({ |
| 72 | + version: core.getInput('cosign-version'), |
| 73 | + ghaNoCache: true, |
| 74 | + skipState: true, |
| 75 | + verifySignature: true |
| 76 | + }); |
| 77 | + await cosignInstall.install(cosignBinPath); |
| 78 | +
|
| 79 | + const cosign = new Cosign(); |
| 80 | + await cosign.printVersion(); |
53 | 81 | - |
54 | 82 | name: Login to registry |
55 | 83 | if: ${{ steps.vars.outputs.signed == 'true' && steps.vars.outputs.output-type == 'image' }} |
|
0 commit comments