Skip to content

Commit

Permalink
make status and init_flags local vars
Browse files Browse the repository at this point in the history
  • Loading branch information
prezha committed Jun 19, 2024
1 parent f278f7b commit 8eae776
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hooks/post-command
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use_image_digest() {
local digest
digest=$(docker inspect --format='{{index .RepoDigests 0}}' "${image}")

status=$?
local status=$?
if [[ $status -ne 0 ]]; then
display_error "docker inspect" "Failed to get the local image digest, will continue using supplied image reference ${image}"
else
Expand Down Expand Up @@ -76,7 +76,7 @@ cosign_init() {
echo "--- :key: Init cosign"

# flags for the cosign initialize command
init_flags=()
local init_flags=()

if [[ "${is_keyless}" == true ]]; then
local tuf_mirror_url=${BUILDKITE_PLUGIN_COSIGN_KEYLESS_CONFIG_TUF_MIRROR_URL}
Expand All @@ -99,7 +99,7 @@ cosign_init() {

cosign initialize "${init_flags[@]}"

status=$?
local status=$?
if [[ $status -ne 0 ]]; then
fail_with_message "cosign" "Failed to initialise"
fi
Expand Down Expand Up @@ -163,7 +163,7 @@ cosign_sign() {
"${sign_flags[@]}" \
"${image}"

status=$?
local status=$?
if [[ $status -ne 0 ]]; then
fail_with_message "cosign" "Failed to sign image"
fi
Expand Down

0 comments on commit 8eae776

Please sign in to comment.