@@ -32,12 +32,35 @@ inputs:
3232 description : ' Name of the attestation file in the release'
3333 required : false
3434 default : ' attestations.jsonl'
35+ policy :
36+ description : >
37+ Ampel policy locator (VCS locator or path) used by `ampel verify`.
38+ Defaults to a pinned revision of the carabiner-dev policies repo's
39+ slsa-build-point policy.
40+ required : false
41+ default : ' git+https://github.com/carabiner-dev/policies@eed2d09ac2a7f8f5238a24b30492e378d8d77ad3#slsa/slsa-build-point.json'
42+ context :
43+ description : >
44+ Newline-separated context values passed to `ampel verify` as `-x KEY:VALUE`.
45+ When empty, the action injects `buildPoint:git+ssh://github.com/carabiner-dev/<repo>`
46+ derived from the download location, matching the URI scheme used in the
47+ `resolvedDependencies` of carabiner-dev SLSA provenances.
48+ required : false
49+ default : ' '
50+ signers :
51+ description : >
52+ Newline-separated signer identity specs passed to `ampel verify` as `--signer SPEC`.
53+ When empty, the action injects a sigstore regexp spec pinned to the
54+ `<repo>/.github/workflows/release.yaml` workflow under carabiner-dev,
55+ with the tag left as a regex wildcard.
56+ required : false
57+ default : ' '
3558runs :
3659 using : " composite"
3760 steps :
3861 - name : Bootstrap trusted ampel
3962 if : inputs.verify == 'true'
40- uses : carabiner-dev/actions/install/ampel-bootstrap@360ffa1eb909b0105d4eccb6d6ef337911c34952 # v1.1.6
63+ uses : carabiner-dev/actions/install/ampel-bootstrap@0a075bb75a68646d05f99c85cbbf2be40dd8e442 # bootstrap rotated to ampel v1.2.1
4164 id : bootstrap
4265
4366 - name : Detect platform
@@ -85,12 +108,38 @@ runs:
85108 - name : Verify ${{ inputs.tool }} binary
86109 if : inputs.verify == 'true'
87110 shell : bash
111+ env :
112+ CONTEXT_INPUT : ${{ inputs.context }}
113+ SIGNERS_INPUT : ${{ inputs.signers }}
114+ DEFAULT_BUILD_POINT : git+ssh://github.com/carabiner-dev/${{ steps.platform.outputs.repo }}
115+ DEFAULT_SIGNER : ' sigstore(regexp)::https://token\.actions\.githubusercontent\.com::https://github\.com/carabiner-dev/${{ steps.platform.outputs.repo }}/\.github/workflows/release\.yaml@refs/tags/[^/]+'
88116 run : |
89117 echo "::group::Verify ${{ inputs.tool }} ${{ inputs.version }}"
90- ${{ steps.bootstrap.outputs.ampel-path }} verify \
91- --subject="${{ inputs.install-dir }}/bin/${{ inputs.tool }}${{ steps.platform.outputs.ext }}" \
92- --collector="https://github.com/carabiner-dev/${{ steps.platform.outputs.repo }}/releases/download/${{ inputs.version }}/${{ inputs.attestation-file }}" \
93- --policy="git+https://github.com/carabiner-dev/policies#slsa/slsa-build-point.json"
118+
119+ args=(verify)
120+ args+=(--subject="${{ inputs.install-dir }}/bin/${{ inputs.tool }}${{ steps.platform.outputs.ext }}")
121+ args+=(--collector="https://github.com/carabiner-dev/${{ steps.platform.outputs.repo }}/releases/download/${{ inputs.version }}/${{ inputs.attestation-file }}")
122+ args+=(--policy="${{ inputs.policy }}")
123+
124+ if [ -n "$CONTEXT_INPUT" ]; then
125+ while IFS= read -r line; do
126+ [ -z "$line" ] && continue
127+ args+=(-x "$line")
128+ done <<< "$CONTEXT_INPUT"
129+ else
130+ args+=(-x "buildPoint:$DEFAULT_BUILD_POINT")
131+ fi
132+
133+ if [ -n "$SIGNERS_INPUT" ]; then
134+ while IFS= read -r line; do
135+ [ -z "$line" ] && continue
136+ args+=(--signer "$line")
137+ done <<< "$SIGNERS_INPUT"
138+ else
139+ args+=(--signer "$DEFAULT_SIGNER")
140+ fi
141+
142+ "${{ steps.bootstrap.outputs.ampel-path }}" "${args[@]}"
94143 echo "::endgroup::"
95144
96145 - if : ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
0 commit comments