diff --git a/action.yml b/action.yml index a912bf2..063ab1c 100644 --- a/action.yml +++ b/action.yml @@ -22,11 +22,12 @@ runs: - shell: bash run: | - sudo curl -Lo /usr/local/bin/vcn https://github.com/vchain-us/vcn/releases/download/v0.9.6/vcn-v0.9.6-linux-amd64-static - sudo chmod a+x /usr/local/bin/vcn + mkdir -p "${{ github.action_path }}/bin" + curl -Lo "${{ github.action_path }}/bin/vcn" https://github.com/vchain-us/vcn/releases/download/v0.9.6/vcn-v0.9.6-linux-amd64-static + chmod a+x "${{ github.action_path }}/bin/vcn" + echo "${{ github.action_path }}/bin" >> $GITHUB_PATH - state="$(vcn authenticate --org home-assistant.io --output json docker://ghcr.io/home-assistant/amd64-builder:${{ steps.version.outputs.version }} | jq '.verification.status // 2')" - if [[ "${state}" != "0" ]]; then + if ! "${{ github.action_path }}/bin/vcn" authenticate --org home-assistant.io --silent docker://ghcr.io/home-assistant/amd64-builder:${{ steps.version.outputs.version }}; then echo "Invalid signature!" exit 1 fi diff --git a/builder.sh b/builder.sh index e64d17c..3074018 100755 --- a/builder.sh +++ b/builder.sh @@ -693,7 +693,6 @@ function codenotary_setup() { function codenotary_sign() { local trust=$1 local image=$2 - local state= local vcn_cli=() if bashio::var.false "${DOCKER_PUSH}" || bashio::var.false "${VCN_NOTARY}"; then @@ -706,8 +705,7 @@ function codenotary_sign() { vcn_cli+=("--org" "${trust}") fi - state="$(vcn authenticate "${vcn_cli[@]}" --output json "docker://${image}" | jq '.verification.status // 2')" - if [[ "${state}" != "0" ]]; then + if ! vcn authenticate "${vcn_cli[@]}" --silent "docker://${image}"; then VCN_NOTARIZATION_PASSWORD="${CODENOTARY_PASSWORD}" vcn notarize --public "docker://${image}" || bashio::exit.nok "Failed to sign the image" fi bashio::log.info "Signed ${image} with ${trust}" @@ -717,7 +715,6 @@ function codenotary_validate() { local trust=$1 local image=$2 local pull=$3 - local state= local vcn_cli=() if ! bashio::var.has_value "${trust}"; then @@ -735,8 +732,7 @@ function codenotary_validate() { vcn_cli+=("--org" "${trust}") fi - state="$(vcn authenticate "${vcn_cli[@]}" --output json "docker://${image}" | jq '.verification.status // 2')" - if [[ "${state}" != "0" ]]; then + if ! vcn authenticate "${vcn_cli[@]}" --silent "docker://${image}" ; then bashio::log.warning "Validation of ${image} fails!" return 1 fi