Skip to content

Commit

Permalink
Remove linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: Jeroen Knoops <jeroen.knoops@philips.com>
  • Loading branch information
JeroenKnoops committed May 11, 2022
1 parent c098a8d commit eddac1d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions container_digest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docker_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "--------------------------------------------------------------------------------------------"

Expand Down
2 changes: 1 addition & 1 deletion update_readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eddac1d

Please sign in to comment.