File tree Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,11 @@ name: Build and Push Alpine Docker Image
3
3
on :
4
4
repository_dispatch :
5
5
types : [caddy-release]
6
- workflow_dispatch : # Allows manual triggering
6
+ workflow_dispatch :
7
+ inputs :
8
+ build_version :
9
+ description : ' Caddy version to build (without v prefix, e.g., 2.8.0)'
10
+ required : false
7
11
8
12
permissions :
9
13
contents : write
@@ -39,13 +43,14 @@ jobs:
39
43
- name : Set version if empty
40
44
id : set_version
41
45
run : |
42
- if [ -z "${{ github.event.client_payload.latest_version }}" ]; then
43
- VERSION=$(cat version.json | jq -r '.version' | sed 's/^v//')
44
- echo "VERSION=$VERSION" >> $GITHUB_ENV
45
- else
46
+ if [ -n "${{ github.event.inputs.build_version }}" ]; then
47
+ VERSION=$(echo "${{ github.event.inputs.build_version }}" | sed 's/^v//')
48
+ elif [ -n "${{ github.event.client_payload.latest_version }}" ]; then
46
49
VERSION=$(echo "${{ github.event.client_payload.latest_version }}" | sed 's/^v//')
47
- echo "VERSION=$VERSION" >> $GITHUB_ENV
50
+ else
51
+ VERSION=$(cat version.json | jq -r '.version' | sed 's/^v//')
48
52
fi
53
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
49
54
50
55
- name : Check Caddy version availability
51
56
id : check_version
Original file line number Diff line number Diff line change @@ -3,7 +3,11 @@ name: Build and Push Standard Docker Image
3
3
on :
4
4
repository_dispatch :
5
5
types : [caddy-release]
6
- workflow_dispatch : # Allows manual triggering
6
+ workflow_dispatch :
7
+ inputs :
8
+ build_version :
9
+ description : ' Caddy version to build (without v prefix, e.g., 2.8.0)'
10
+ required : false
7
11
8
12
permissions :
9
13
contents : write
@@ -39,13 +43,14 @@ jobs:
39
43
- name : Set version if empty
40
44
id : set_version
41
45
run : |
42
- if [ -z "${{ github.event.client_payload.latest_version }}" ]; then
43
- VERSION=$(cat version.json | jq -r '.version' | sed 's/^v//')
44
- echo "VERSION=$VERSION" >> $GITHUB_ENV
45
- else
46
+ if [ -n "${{ github.event.inputs.build_version }}" ]; then
47
+ VERSION=$(echo "${{ github.event.inputs.build_version }}" | sed 's/^v//')
48
+ elif [ -n "${{ github.event.client_payload.latest_version }}" ]; then
46
49
VERSION=$(echo "${{ github.event.client_payload.latest_version }}" | sed 's/^v//')
47
- echo "VERSION=$VERSION" >> $GITHUB_ENV
50
+ else
51
+ VERSION=$(cat version.json | jq -r '.version' | sed 's/^v//')
48
52
fi
53
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
49
54
50
55
- name : Check Caddy version availability
51
56
id : check_version
You can’t perform that action at this time.
0 commit comments