File tree 3 files changed +10
-6
lines changed
3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
1
FROM alpine:latest
2
2
RUN apk add --update --no-cache --no-progress curl jq
3
- COPY get-next-tag-number .sh /get-next-tag-number .sh
4
- ENTRYPOINT ["/get-next-tag-number .sh" ]
3
+ COPY action .sh /action .sh
4
+ ENTRYPOINT ["/action .sh" ]
Original file line number Diff line number Diff line change 17
17
id : next-tag
18
18
uses : codebandits/github-actions/next-image-tag-number@main
19
19
with :
20
- image_repository_url : https:// registry.example.com/v2/my-repo/my- image
20
+ image_repository_url : registry.example.com/repository/ image
21
21
bearer_token : ${{ secrets.REPO_BEARER_TOKEN }}
22
22
initial_number : 100
23
23
tag_prefix : build-
27
27
28
28
## Inputs
29
29
30
- - ` image_repository_url:` **Required.** The URL of the OCI-compatible image repository.
30
+ - ` image_repository_url:` **Required.** The URL of the OCI-compatible image repository. If the protocol is omitted, https is assumed.
31
31
- ` bearer_token:` Optional. The bearer token for repository authentication. Defaults to empty (no authentication).
32
32
- ` initial_number:` Optional. Starting tag number if no tags exist in the repository. Defaults to 1.
33
33
- ` tag_prefix:` Optional. Prefix for the tags. Defaults to build-.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env sh
2
2
3
- REPOSITORY_URL=$1
3
+ if ! echo " $1 " | grep -q " ^http" ; then
4
+ IMAGE_REPOSITORY_URL=" https://$1 "
5
+ else
6
+ IMAGE_REPOSITORY_URL=" $1 "
7
+ fi
4
8
BEARER_TOKEN=$2
5
9
INITIAL_NUMBER=${3:- 1}
6
10
TAG_PREFIX=${4:- " build-" }
11
15
AUTH_HEADER=" "
12
16
fi
13
17
14
- TAGS=$( curl -s $AUTH_HEADER " ${REPOSITORY_URL } /tags/list" | jq -r ' .tags[]' || echo " " )
18
+ TAGS=$( curl -s $AUTH_HEADER " ${IMAGE_REPOSITORY_URL } /tags/list" | jq -r ' .tags[]' || echo " " )
15
19
16
20
if [ -z " $TAGS " ]; then
17
21
echo " No existing tags were found. Using initial tag number ${INITIAL_NUMBER} ."
You can’t perform that action at this time.
0 commit comments