15 Commits

Author SHA1 Message Date
1050a93015 remove debu output
Some checks failed
Test / test-always-true (push) Failing after 5s
Test / test-always-false (push) Failing after 5s
2023-12-08 20:33:29 +01:00
18a82250d2 a
Some checks failed
Test / test-always-true (push) Failing after 6s
Test / test-always-false (push) Failing after 6s
2023-12-08 20:30:22 +01:00
d1cf9d3820 a
Some checks failed
Test / test-always-true (push) Failing after 5s
Test / test-always-false (push) Failing after 5s
2023-12-08 20:27:03 +01:00
f430edba60 small echo
Some checks failed
Test / test-always-true (push) Failing after 5s
Test / test-always-false (push) Failing after 6s
2023-12-08 20:17:23 +01:00
42a1e2a366 l
Some checks failed
Test / test-always-true (push) Failing after 5s
Test / test-always-false (push) Failing after 5s
2023-12-08 20:13:02 +01:00
93e41e7203 "" 2023-12-08 15:00:06 +01:00
8c8c530d4e asd 2023-12-08 14:51:46 +01:00
a73015164e asd 2023-12-08 14:44:09 +01:00
37c6659976 (( 2023-12-08 14:17:40 +01:00
a711f6e5cb test 2023-12-08 14:09:33 +01:00
2707de296c check if tags exist 2023-12-08 13:51:08 +01:00
Clement Tsang
d8cf79d3bc Update README.md 2023-01-11 01:07:37 -05:00
Clement Tsang
ef9110c42e fix default branch name in test 2022-11-03 20:29:14 -04:00
Clement Tsang
d433f7fe01 replace set-output usage (#1) 2022-11-03 20:12:47 -04:00
Clement Tsang
145289dcb7 Update README.md 2022-06-02 01:29:21 -04:00
4 changed files with 20 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ on:
pull_request:
workflow_dispatch:
push:
branches: [master]
branches: [main]
jobs:
test-always-true:

View File

@@ -35,9 +35,9 @@ The action returns either `true` or `false`, indicating if the derived image dif
```yaml
- name: Run
id: run
uses: ClementTsang/docker-check-base-image-diff@v0.0.1-alpha
with:
id: run
uses: ClementTsang/docker-check-base-image-diff@v0.0.2
with:
base-image: docker://rust:slim-buster
derived-image: docker://ghcr.io/clementtsang/cargo-deb-arm
```

View File

@@ -6,16 +6,16 @@ branding:
color: blue
inputs:
base-image:
image:
description: "Base Docker image - follows skopeo format (e.g. docker://rust:slim-buster)"
required: true
derived-image:
description: "Derived Docker image - follows skopeo format (e.g. docker://rust:slim-buster)"
tags:
description: "list of tags"
required: true
outputs:
differs:
exist:
description: "Returns either true or false"
value: ${{ steps.check.outputs.differs }}
value: ${{ steps.check.outputs.exist }}
runs:
using: "composite"
@@ -23,5 +23,4 @@ runs:
- id: check
shell: bash
run: |
RESULT=$(${{ github.action_path }}/check.sh ${{ inputs.base-image }} ${{ inputs.derived-image }})
echo "::set-output name=differs::$RESULT"
${{ github.action_path }}/check.sh "${{ inputs.image }}" "${{ inputs.tags }}"

View File

@@ -2,7 +2,14 @@
set -e
BASE_LAYERS="$(skopeo inspect $1 | jq '.Layers')"
DERIVED_LAYERS="$(skopeo inspect $2 | jq '.Layers')"
CHECK=$( echo -n "$2" | sed -e "s#$1:##g" | jq -R -s 'split("\n")' )
EXISTING=$( skopeo list-tags docker://$1 || echo '{"Tags":[]}' )
TAGS=$( jq '.check - .existing.Tags' <<< "{\"check\": $CHECK, \"existing\": $EXISTING}" )
jq '.base - .derived | .!=[]' <<< "{\"base\": $BASE_LAYERS, \"derived\": $DERIVED_LAYERS}"
echo $TAGS | jq '"Tag not found: "+ .[]'
RESULT=$(echo $TAGS | jq '.==[]')
if "$RESULT" == "true"
then
echo "All tags found"
fi
echo exist=$RESULT >> $GITHUB_OUTPUT