Skip to content

Commit 6360fcf

Browse files
authored
Merge pull request #953 from linuxserver/template-workflow-v2
2 parents 2791cfc + 71ed9ae commit 6360fcf

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

Diff for: .github/workflows/BuildImage.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
name: Build Image
22

3-
on: [push, pull_request_target, workflow_dispatch]
3+
on:
4+
push:
5+
pull_request_target:
6+
workflow_dispatch:
7+
inputs:
8+
mod_version:
9+
type: string
10+
required: false
411

512
env:
613
GITHUB_REPO: "linuxserver/docker-mods" #don't modify
714
ENDPOINT: "linuxserver/mods" #don't modify
815
BASEIMAGE: "replace_baseimage" #replace
916
MODNAME: "replace_modname" #replace
17+
MOD_VERSION: ${{ inputs.mod_version }} #don't modify
1018
MULTI_ARCH: "true" #set to false if not needed
1119

1220
jobs:
@@ -21,8 +29,13 @@ jobs:
2129
echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT
2230
echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT
2331
echo "MULTI_ARCH=${{ env.MULTI_ARCH }}" >> $GITHUB_OUTPUT
24-
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
25-
MOD_VERSION=""
32+
if [[ -z "${{ env.MOD_VERSION }}" ]]; then
33+
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
34+
MOD_VERSION=""
35+
else
36+
MOD_VERSION=${{ env.MOD_VERSION }}
37+
echo "MOD_VERSION_OVERRIDE=true" >> $GITHUB_OUTPUT
38+
fi
2639
echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT
2740
outputs:
2841
GITHUB_REPO: ${{ steps.outputs.outputs.GITHUB_REPO }}
@@ -31,6 +44,7 @@ jobs:
3144
MODNAME: ${{ steps.outputs.outputs.MODNAME }}
3245
MULTI_ARCH: ${{ steps.outputs.outputs.MULTI_ARCH }}
3346
MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }}
47+
MOD_VERSION_OVERRIDE: ${{ steps.outputs.outputs.MOD_VERSION_OVERRIDE }}
3448

3549
build:
3650
uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v1
@@ -47,3 +61,4 @@ jobs:
4761
MODNAME: ${{ needs.set-vars.outputs.MODNAME }}
4862
MULTI_ARCH: ${{ needs.set-vars.outputs.MULTI_ARCH }}
4963
MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }}
64+
MOD_VERSION_OVERRIDE: ${{ needs.set-vars.outputs.MOD_VERSION_OVERRIDE }}

0 commit comments

Comments
 (0)