E586 Create separate assertion docs based on matrix data (#10) · nginxinc/compliance-rules@c69acf3 · GitHub
[go: up one dir, main page]

Skip to content

Commit c69acf3

Browse files
authored
Create separate assertion docs based on matrix data (#10)
* update filename Signed-off-by: Jakub Jarosz <j.jarosz@f5.com> * fix var name Signed-off-by: Jakub Jarosz <j.jarosz@f5.com> * create unique tar Signed-off-by: Jakub Jarosz <j.jarosz@f5.com> * fix typo Signed-off-by: Jakub Jarosz <j.jarosz@f5.com> * fix name Signed-off-by: Jakub Jarosz <j.jarosz@f5.com> * cleanup Signed-off-by: Jakub Jarosz <j.jarosz@f5.com> * use unique name Signed-off-by: Jakub Jarosz <j.jarosz@f5.com> * simplify name Signed-off-by: Jakub Jarosz <j.jarosz@f5.com> --------- Signed-off-by: Jakub Jarosz <j.jarosz@f5.com>
1 parent 311fe9c commit c69acf3

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/actions/sign/action.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,27 @@ runs:
1616
id: sign
1717
run: |
1818
cosign_binary=${COSIGN_BIN:-"cosign"}
19-
sha256sum ${{ inputs.assertion-doc }} >> "${{ inputs.assertion-doc }}_checksum.txt"
20-
checksum_file="${{ inputs.assertion-doc }}_checksum.txt"
19+
20+
# Get assertion json file basename
21+
assertiondoc=$(basename "${{ inputs.assertion-doc }}")
22+
sha256sum "${assertiondoc}" >> "${assertiondoc}_checksum.txt"
23+
checksum_file="${assertiondoc}_checksum.txt"
24+
25+
# Sign
2126
${cosign_binary} sign-blob "${checksum_file}" --output-signature="${checksum_file}.sig" --output-certificate="${checksum_file}.pem" -y
22-
tar -cvf assertion.tar assertion*
23-
echo "assertiontar=$(find -type f -name "assertion.tar" | head -n 1)" >> $GITHUB_OUTPUT
27+
28+
# Create tarball
29+
tarball_name="${assertiondoc}.tar.gz"
30+
tar -czf "${tarball_name}" "${assertiondoc}" "${checksum_file}" "${checksum_file}.sig" "${checksum_file}.pem"
31+
32+
# Create output var
33+
echo "assertiontar=${tarball_name}" >> $GITHUB_OUTPUT
34+
echo $GITHUB_OUTPUT
2435
shell: bash
2536

2637
- name: Store assertion document
2738
uses: actions/upload-artifact@v4
2839
with:
29-
name: assertion
40+
name: ${{ steps.sign.outputs.assertiontar }}
3041
path: ${{ steps.sign.outputs.assertiontar }}
3142
retention-days: 7

0 commit comments

Comments
 (0)
0