From 590dd3c83f1894a51a340cf03b2a794a2b1e1685 Mon Sep 17 00:00:00 2001 From: Espen Hagen <2492641+espenhgn@users.noreply.github.com> Date: Tue, 30 Apr 2024 14:28:29 +0200 Subject: [PATCH] faak --- .github/workflows/docker_build_push.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker_build_push.yml b/.github/workflows/docker_build_push.yml index fe21f56..abb7b02 100644 --- a/.github/workflows/docker_build_push.yml +++ b/.github/workflows/docker_build_push.yml @@ -84,12 +84,17 @@ jobs: - name: Pull and push Singularity container run: | tags="${{ steps.meta.outputs.tags }}" - IFS=$'\n' read -r -d '' -a tags_array <<< "$tags" - echo "$tags" - echo ${{ secrets.GITHUB_TOKEN }} | oras login --username ${{ github.repository_owner }} --password-stdin ghcr.io - for tag in "${tags_array[@]}"; do - echo "processing: " "$tag" - singularity pull nothingtoseehere.sif docker://"$tag" - oras push ghcr.io/"$tag" --artifact-type application/vnd.acme.rocket.config nothingtoseehere.sif - done + if [ -n "$tags" ]; then + IFS=$'\n' read -r -d '' -a tags_array <<< "$tags" + echo "Number of tags: ${#tag_array[@]}" + echo "$tags" + echo ${{ secrets.GITHUB_TOKEN }} | oras login --username ${{ github.repository_owner }} --password-stdin ghcr.io + for tag in "${tags_array[@]}"; do + echo "processing tag: $tag" + singularity pull nothingtoseehere.sif docker://"$tag" + oras push ghcr.io/"$tag" --artifact-type application/vnd.acme.rocket.config nothingtoseehere.sif + done + else + echo "No tags found" + fi shell: bash