From eddac1dd0abfb9176ccf9478b12b950dae2ee2c9 Mon Sep 17 00:00:00 2001 From: Jeroen Knoops Date: Wed, 11 May 2022 06:29:35 +0100 Subject: [PATCH] Remove linter errors Signed-off-by: Jeroen Knoops --- container_digest.sh | 13 +++++++------ docker_push.sh | 6 +++--- update_readme.sh | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/container_digest.sh b/container_digest.sh index ad8bba3..dbb66a4 100755 --- a/container_digest.sh +++ b/container_digest.sh @@ -62,9 +62,10 @@ echo "========================================================================== echo "Finished getting docker digest and tags" echo "============================================================================================" +echo '## Secure Software Supply Chain :rocket:' >> "$GITHUB_STEP_SUMMARY" if [ -n "${SIGN}" ] then - echo '## Sign image' >> $GITHUB_STEP_SUMMARY + echo '### Sign image' >> "$GITHUB_STEP_SUMMARY" echo "Signing image" COSIGN_KEY=$(mktemp /tmp/cosign.XXXXXXXXXX) || exit 1 @@ -85,12 +86,12 @@ then echo '```bash' echo "cosign verify --key cosign.pub $docker_registry_prefix/$imagename@${containerdigest}" echo '```' - } >> $GITHUB_STEP_SUMMARY + } >> "$GITHUB_STEP_SUMMARY" fi if [ -n "${SLSA_PROVENANCE}" ] then - echo "## SLSA Provenance" >> $GITHUB_STEP_SUMMARY + echo "### SLSA Provenance" >> "$GITHUB_STEP_SUMMARY" echo "Running SLSA Provenance" encoded_github="$(echo "$GITHUB_CONTEXT" | base64 -w 0)" @@ -127,13 +128,13 @@ then echo '```bash' echo "cosign verify-attestation --key cosign.pub $docker_registry_prefix/$imagename@${containerdigest} | jq '.payload |= @base64d | .payload | fromjson | select(.predicateType==\"https://slsa.dev/provenance/v0.2\" ) | .'" echo '```' - } >> $GITHUB_STEP_SUMMARY + } >> "$GITHUB_STEP_SUMMARY" fi fi if [ -n "${SBOM}" ] then - echo "## SBOM" >> $GITHUB_STEP_SUMMARY + echo "### SBOM" >> "$GITHUB_STEP_SUMMARY" echo "Using Syft to generate SBOM" syft packages "$docker_registry_prefix"/"$imagename"@"${containerdigest}" -o spdx-json=sbom-spdx-formatted.json @@ -161,7 +162,7 @@ then echo '```bash' echo "cosign verify-attestation --key cosign.pub $docker_registry_prefix/$imagename@${containerdigest} | jq '.payload |= @base64d | .payload | fromjson | select( .predicateType==\"https://spdx.dev/Document\" ) | .predicate.Data | fromjson | .'" echo '```' - } >> $GITHUB_STEP_SUMMARY + } >> "$GITHUB_STEP_SUMMARY" fi fi diff --git a/docker_push.sh b/docker_push.sh index df6a73c..cf5fb36 100755 --- a/docker_push.sh +++ b/docker_push.sh @@ -55,15 +55,15 @@ echo "$DOCKER_PASSWORD" | docker login "$DOCKER_REGISTRY" -u "$DOCKER_USERNAME" echo '| Image |' echo '| ---- |' echo "| $docker_registry_prefix/$imagename:$basetag |" -} >> $GITHUB_STEP_SUMMARY +} >> "$GITHUB_STEP_SUMMARY" docker push "$docker_registry_prefix"/"$imagename":"$basetag" for tag in "${tags[@]:1}"; do - echo "| $docker_registry_prefix/$imagename:$tag |" >> $GITHUB_STEP_SUMMARY + echo "| $docker_registry_prefix/$imagename:$tag |" >> "$GITHUB_STEP_SUMMARY" docker push "$docker_registry_prefix"/"$imagename":"$tag" done -echo '' >> $GITHUB_STEP_SUMMARY +echo '' >> "$GITHUB_STEP_SUMMARY" echo "--------------------------------------------------------------------------------------------" diff --git a/update_readme.sh b/update_readme.sh index 89ae3fb..48dfa26 100755 --- a/update_readme.sh +++ b/update_readme.sh @@ -21,7 +21,7 @@ RESPONSE_CODE=$(curl -s --write-out %{response_code} --output /dev/null -H "Auth echo "Received response code: $RESPONSE_CODE" if [ "$RESPONSE_CODE" -eq 200 ]; then - echo "Readme updated successfully" >> $GITHUB_STEP_SUMMARY + echo "Readme updated successfully" >> "$GITHUB_STEP_SUMMARY" else echo "Error updating readme" exit 1