Skip to content

Commit

Permalink
chore: deprecate image-ref, and merge it with subjects
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ilgayev committed Jun 22, 2024
1 parent 55c8677 commit c361a0c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/verify-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ jobs:
report-artifact: true
fail-on-error: true

verify-provenance-image-ref:
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Run Cimon
uses: ./attest
with:
image-ref: 'cycodelabs/cimon@sha256:ad4ab84178621f359a5ec1ba9eff8ba46626d8d1999416646b6aaa96bfcbf802'
report-job-summary: true
report-artifact: true
fail-on-error: true

verify-agent-and-attest:
runs-on: ubuntu-22.04
steps:
Expand Down
4 changes: 2 additions & 2 deletions attest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ inputs:
required: false
default: ''
subjects:
description: A white space seperated list of paths, or base64-encoded subjects. Either subjects or imageRef are required
description: A white space seperated list of paths, or base64-encoded subjects. Each path can be file, directory or image reference
required: false
default: ''
image-ref:
description: The container reference to generate provenance for. Either subjects or imageRef are required
description: (deprecated) The container reference to generate provenance for. Either subjects or imageRef are required
required: false
default: ''
sign-key:
Expand Down
8 changes: 7 additions & 1 deletion attest/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10911,10 +10911,16 @@ async function run(config) {
releasePath = CIMON_EXECUTABLE_PATH;
}

if (config.cimon.imageRef !== '') {
_actions_core__WEBPACK_IMPORTED_MODULE_0__.warning(
'image-ref parameter is deprecated and will be removed in future versions. Please use subjects parameter instead.'
);
config.attest.subjects = config.attest.imageRef;
}

const env = {
...process.env,
CIMON_SUBJECTS: config.attest.subjects,
CIMON_ATTEST_IMAGE_REF: config.attest.imageRef,
CIMON_SIGN_KEY: config.attest.signKey,
CIMON_PROVENANCE_OUTPUT: config.attest.provenanceOutput,
CIMON_SIGNED_PROVENANCE_OUTPUT: config.attest.signedProvenanceOutput,
Expand Down
8 changes: 7 additions & 1 deletion attest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,16 @@ async function run(config) {
releasePath = CIMON_EXECUTABLE_PATH;
}

if (config.cimon.imageRef !== '') {
core.warning(
'image-ref parameter is deprecated and will be removed in future versions. Please use subjects parameter instead.'
);
config.attest.subjects = config.attest.imageRef;
}

const env = {
...process.env,
CIMON_SUBJECTS: config.attest.subjects,
CIMON_ATTEST_IMAGE_REF: config.attest.imageRef,
CIMON_SIGN_KEY: config.attest.signKey,
CIMON_PROVENANCE_OUTPUT: config.attest.provenanceOutput,
CIMON_SIGNED_PROVENANCE_OUTPUT: config.attest.signedProvenanceOutput,
Expand Down

0 comments on commit c361a0c

Please sign in to comment.