diff --git a/action.yml b/action.yml index 3bf6f6f..eb8b34e 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,8 @@ name: 'Cache NuGet Packages' description: '快取 NUGET 套件' +inputs: + cache-arch: + description: '指定快取 NUGET 套件的架構,避免還原失敗' outputs: cache-hit: description: '表示是否命中快取' @@ -12,6 +15,6 @@ runs: uses: actions/cache@v4 with: path: ~/.nuget/packages - key: ${{ runner.os }}-${{ runner.arch }}-nuget-${{ hashFiles('NuGet.Config', '**/*.sln', '**/*.csproj', '**/global.json', '**/packages.lock.json', '**/Directory.Build.props', '**/Directory.Build.targets') }} + key: ${{ inputs.cache-arch || runner.os }}-nuget-${{ hashFiles('NuGet.Config', '**/*.sln', '**/*.csproj', '**/global.json', '**/packages.lock.json', '**/Directory.Build.props', '**/Directory.Build.targets') }} restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-nuget- + ${{ inputs.cache-arch || runner.os }}-nuget-