Compare commits
No commits in common. "a89aee26dfd3bfb8530bf82916118d97d1d37f33" and "25079958b1f0ebe8989cb06e3572bbd0595a59e2" have entirely different histories.
a89aee26df
...
25079958b1
2 changed files with 21 additions and 1 deletions
|
@ -7,7 +7,7 @@ on:
|
|||
branches:
|
||||
- main
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
build:
|
||||
|
|
20
check-image.sh
Executable file
20
check-image.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
LOCAL_IMAGE=$1
|
||||
REMOTE_IMAGE=$2
|
||||
|
||||
# Vérifier si le nom de l'image a été fourni
|
||||
if [[ -z "$LOCAL_IMAGE" || -z "$REMOTE_IMAGE" ]]; then
|
||||
echo "Usage: $0 <LOCAL_IMAGE> <REMOTE_IMAGE>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
REMOTE_IMAGE_DIGEST=$(curl -s "https://hub.docker.com/v2/repositories/$REMOTE_IMAGE/tags/latest/" | jq .digest)
|
||||
|
||||
RESULT=$(docker image inspect "$LOCAL_IMAGE" | jq '[[.[0].RepoDigests.[] | split("@")].[] | last] | unique | contains(['"$REMOTE_IMAGE_DIGEST"'])')
|
||||
|
||||
if [[ "$RESULT" == "true" ]]; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in a new issue