Skip to content

Commit 9ed170b

Browse files
committed
feature: strict version check
1 parent 50a122d commit 9ed170b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

action.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,28 @@ inputs:
2929
description: "Skip release if only these files are changed"
3030
default: "SECURITY.md,.github/README.md,docs/README_nuget.md,.github/workflows/release.yml,.github/workflows/auto-assign.yml,.github/workflows/build.yml,.github/workflows/create-pr.yml,.github/workflows/sync-branches.yml,.github/workflows/update-releases.yml,docs/"
3131
required: false
32+
strict-umbraco-version:
33+
description: "Fails the build if the computed Input Major Version does not match this Action's Major version - Used to ensure builds are deterministic for Umbraco releases."
34+
required: false
35+
default: "true"
3236
runs:
3337
using: "composite"
3438
steps:
39+
- name: Check Umbraco Version
40+
id: check-umbraco-version
41+
shell: bash
42+
if: ${{ inputs.strict-umbraco-version == 'true' }}
43+
run: |
44+
45+
MAJOR_VERSION=$(echo "${{ inputs.version }}" | cut -d. -f1)
46+
UMBRACO_VERSION="17"
47+
if [ "$MAJOR_VERSION" != "$UMBRACO_VERSION" ]; then
48+
echo "Umbraco version mismatch - expected $UMBRACO_VERSION but got $MAJOR_VERSION"
49+
echo "Check the branch you are building from is correct, GitVersion.yml is configured correctly and that you are using the correct version of this Action for the Umbraco version you are building."
50+
exit 1
51+
fi
3552
- name: Checkout code
36-
uses: actions/checkout@v4
53+
uses: actions/checkout@v5
3754
with:
3855
fetch-depth: 0
3956
- name: Check for changes
@@ -170,7 +187,7 @@ runs:
170187
echo "NUGET_SOURCE=${{ inputs.nuget-source }}" >> $GITHUB_ENV
171188
- name: Download package
172189
if: ${{ env.SKIP == 'false' }}
173-
uses: actions/download-artifact@v4
190+
uses: actions/download-artifact@v6
174191
with:
175192
name: ${{ env.ARTIFACT_NAME }}
176193
path: ${{ env.ARTIFACT_PATH }}

0 commit comments

Comments
 (0)