Skip to content

Commit

Permalink
fixup! chore(dryrun): remove bash script and use github action
Browse files Browse the repository at this point in the history
  • Loading branch information
g-iannelli committed Dec 9, 2024
1 parent 1b6fdec commit 4ff5a24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/actions/skopeo-sync/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@ runs:
REGISTRY_AUTH_FILE: ${{ inputs.registry_auth_file }}
run: |
#!/bin/bash
set -x
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 }}."
Expand Down Expand Up @@ -130,17 +131,17 @@ 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 \
--override-arch amd64 \
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 \
Expand Down Expand Up @@ -196,4 +197,4 @@ runs:
shell: bash
run: |
echo "WARN[${{ inputs.source }}:${{ inputs.tag }}]: dry run is enabled and no sync will be executed"
exit 1
exit 100
1 change: 1 addition & 0 deletions .github/workflows/dry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
paths:
- '.github/workflows/dry.yml'
- '.github/actions/**'
- 'modules/**'
- '!README.md'

Expand Down

0 comments on commit 4ff5a24

Please sign in to comment.