diff --git a/.github/workflows/build-loader.yml b/.github/workflows/build-loader.yml index 95d2f34..85f65ce 100644 --- a/.github/workflows/build-loader.yml +++ b/.github/workflows/build-loader.yml @@ -3,6 +3,19 @@ name: Build Loader on: push: branches: [master] + # Only build when something that actually affects the output changed. + # README / docs / issue templates / .gitignore / .claude/ get to skip. + # Use workflow_dispatch (below) to force a run for anything else. + paths: + - 'src/**' + - 'native/**' + - 'build.gradle' + - 'settings.gradle' + - 'gradle.properties' + - 'gradle/wrapper/**' + - 'gradlew' + - 'gradlew.bat' + - '.github/workflows/build-loader.yml' workflow_dispatch: {} # contents: write so the [Release] commit-marker path can create a @@ -17,6 +30,12 @@ jobs: runs-on: windows-2022 timeout-minutes: 180 + # Honour a [SKIP CI] marker (case-insensitive — GitHub's contains() is + # case-insensitive for string operands) anywhere in the head commit + # message. workflow_dispatch always runs since head_commit is null + # there and the !contains() short-circuits to true. + if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[SKIP CI]') }} + env: # NOTE: do not declare VCPKG_ROOT here. The windows-2022 runner # ships VS Enterprise which pre-sets a system-wide VCPKG_ROOT @@ -176,7 +195,9 @@ jobs: shell: pwsh run: | $msg = (git log -1 --pretty=%B HEAD | Out-String) - $isRelease = $msg.Contains("[Release]") + # Case-insensitive match so [release], [Release], [RELEASE] all + # qualify; .Contains in .NET is case-sensitive by default. + $isRelease = $msg.IndexOf("[Release]", [System.StringComparison]::OrdinalIgnoreCase) -ge 0 "is_release=$($isRelease.ToString().ToLower())" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append Write-Host "HEAD commit message:"