diff --git a/.github/actions/artifact_delete/delete_artifact.sh b/.github/actions/artifact_delete/delete_artifact.sh index 956927116d..9423048317 100755 --- a/.github/actions/artifact_delete/delete_artifact.sh +++ b/.github/actions/artifact_delete/delete_artifact.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # get_artifact_id retrieves the artifact id of # an artifact that was generated by a workflow. @@ -9,7 +9,7 @@ function get_artifact_id { -H "X-GitHub-Api-Version: 2022-11-28" \ --paginate \ "/repos/edgelesssys/constellation/actions/runs/$1/artifacts" --jq ".artifacts |= map(select(.name==\"$2\")) | .artifacts[0].id" || exit 1)" - echo "$artifact_id" + echo "$artifact_id" | tr -d "\n" } # delete_artifact_by_id deletes an artifact by its artifact id. @@ -25,14 +25,7 @@ function delete_artifact_by_id { workflow_id="$1" artifact_name="$2" -if [[ -z $workflow_id ]]; then - echo "[X] No workflow id provided." - echo "Usage: delete_artifact.sh " - exit 1 -fi - -if [[ -z $artifact_name ]]; then - echo "[X] No artifact name provided." +if [[ -z $workflow_id ]] || [[ -z $artifact_name ]]; then echo "Usage: delete_artifact.sh " exit 1 fi