From d95d8c980d77ff7b191a0730d238742ca370c6dc Mon Sep 17 00:00:00 2001 From: Giuseppe Iannelli Date: Mon, 9 Dec 2024 14:47:55 +0100 Subject: [PATCH] fixup! chore(dryrun): remove bash script and use github action --- .github/actions/skopeo-sync/action.yaml | 10 +++++----- .github/workflows/dry.yml | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/actions/skopeo-sync/action.yaml b/.github/actions/skopeo-sync/action.yaml index d710557..ba04efe 100644 --- a/.github/actions/skopeo-sync/action.yaml +++ b/.github/actions/skopeo-sync/action.yaml @@ -36,14 +36,14 @@ runs: curl -sL https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64 -o /usr/local/bin/jq chmod +x /usr/local/bin/jq + set +e # Fetch source and target image details source_manifest=$(skopeo inspect --raw docker://${{ inputs.source }}:${{ inputs.tag }} 2>&1) if [[ $? -ne 0 ]]; then echo "Error can't get info about ${{ inputs.source }}:${{ inputs.tag }}. Exit!" - exit 1 + exit 255 fi - set +e target_manifest=$(skopeo inspect --raw docker://${{ inputs.destination }}:${{ inputs.tag }} 2> /dev/null) if [[ $? -ne 0 ]]; then echo "Error can't get info about ${{ inputs.destination }}:${{ inputs.tag }}." @@ -130,6 +130,7 @@ runs: curl -sL https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64 -o /usr/local/bin/jq chmod +x /usr/local/bin/jq + set +e # Fetch source and target image details source_manifest=$(skopeo inspect \ --override-os linux \ @@ -137,10 +138,9 @@ runs: docker://${{ inputs.source }}:${{ inputs.tag }} 2>&1) if [[ $? -ne 0 ]]; then echo "Error can't get info about ${{ inputs.source }}:${{ inputs.tag }}. Exit!" - exit 1 + exit 255 fi - set +e target_manifest=$(skopeo inspect \ --override-os linux \ --override-arch amd64 \ @@ -196,4 +196,4 @@ runs: shell: bash run: | echo "WARN[${{ inputs.source }}:${{ inputs.tag }}]: dry run is enabled and no sync will be executed" - exit 1 \ No newline at end of file + exit 100 \ No newline at end of file diff --git a/.github/workflows/dry.yml b/.github/workflows/dry.yml index 7b0439b..c01c36c 100644 --- a/.github/workflows/dry.yml +++ b/.github/workflows/dry.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/dry.yml' + - '.github/actions/**' - 'modules/**' - '!README.md'