File tree 2 files changed +14
-13
lines changed
2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
- if ! echo " $1 " | grep -q " ^http" ; then
6
- IMAGE_REPOSITORY_URL=" https://$1 "
7
- else
8
- IMAGE_REPOSITORY_URL=" $1 "
9
- fi
10
- BEARER_TOKEN=$2
11
- INITIAL_NUMBER=${3}
12
- TAG_PREFIX=${4}
5
+ REPOSITORY_API_URL=$1
6
+ IMAGE_NAME=$2
7
+ BEARER_TOKEN=$3
8
+ INITIAL_NUMBER=$4
9
+ TAG_PREFIX=$5
13
10
14
11
if [ -n " $BEARER_TOKEN " ]; then
15
12
AUTH_HEADER=" -H \" Authorization: Bearer ${BEARER_TOKEN} \" "
16
13
else
17
14
AUTH_HEADER=" "
18
15
fi
19
16
20
- TAGS_LIST_JSON=$( curl -fs $AUTH_HEADER " ${IMAGE_REPOSITORY_URL } /tags/list" )
17
+ TAGS_LIST_JSON=$( curl -fs $AUTH_HEADER " ${REPOSITORY_API_URL} / ${IMAGE_NAME } /tags/list" )
21
18
TAGS=$( echo " $TAGS_LIST_JSON " | jq -r ' .tags[]' || echo " " )
22
19
23
20
if [ -z " $TAGS " ]; then
Original file line number Diff line number Diff line change @@ -2,11 +2,14 @@ name: Next Image Tag Number
2
2
description : Get the next tag number for an image in an OCI repository.
3
3
4
4
inputs :
5
- image_repository_url :
6
- description : The URL of the OCI-compatible image repository.
5
+ repository_api_url :
6
+ description : The full URL of the OCI-compatible repository API.
7
+ required : true
8
+ image :
9
+ description : The name of the image within the specified repository.
7
10
required : true
8
11
bearer_token :
9
- description : Optional bearer token for repository authentication.
12
+ description : Optional bearer token for authentication.
10
13
required : false
11
14
initial_number :
12
15
description : Starting tag number if no tags exist.
27
30
using : docker
28
31
image : Dockerfile
29
32
args :
30
- - ${{ inputs.image_repository_url }}
33
+ - ${{ inputs.repository_api_url }}
34
+ - ${{ inputs.image }}
31
35
- ${{ inputs.bearer_token }}
32
36
- ${{ inputs.initial_number }}
33
37
- ${{ inputs.tag_prefix }}
You can’t perform that action at this time.
0 commit comments