forked from lucacome/docker-image-update-checker
-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
49 lines (47 loc) · 1.64 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
name: "Registry Image Update Checker"
description: "GitHub Action to check if the base container image that your image is based on was updated and your image needs to be updated"
author: Giovanni Bassi <giggio@giggio.net>
inputs:
base-image:
description: "Container base image"
required: true
image:
description: "Container image"
required: true
os:
description: "OS being used, will default to the OS running the action."
required: false
default: ""
arch:
description: "Architecture of the image, used for multiarch images. Like amd64 or arm64. Will default to the OS architecture running the action (limited support)."
required: false
default: ""
verbose:
description: "Show verbose output"
required: false
default: "false"
outputs:
needs-updating:
description: "true or false, true if the image needs updating (does not match the base image), false if it does not need updating"
value: ${{ steps.run-script.outputs.result }}
runs:
using: "composite"
steps:
- id: run-script
run: |
OUTPUT=`FULL_BASE=${{ inputs.base-image }} FULL_IMAGE=${{ inputs.image }} OS=${{ inputs.os }} ARCH=${{ inputs.arch }} VERBOSE=${{ inputs.verbose }} $GITHUB_ACTION_PATH/docker.sh`
if [ "$?" != "0" ]; then
>&2 echo "Error running update checker action."
exit 1
fi
if [ "${{ inputs.verbose }}" == "true" ]; then
echo "`head -n -1 <<< $OUTPUT`"
OUTPUT=`tail -n1 <<< $OUTPUT`
echo needs-updating: $OUTPUT
fi
echo "result=$OUTPUT" >> $GITHUB_OUTPUT
shell: bash
branding:
icon: refresh-cw
color: blue