From 587ee4d86d45a9591e456c13fc348564dab57655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Wed, 11 Nov 2026 20:36:50 +0100 Subject: [PATCH 1/2] Install the analyzer modules from PSGallery, drop psmodulecache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit potatoqualitee/psmodulecache is a composite action and its own actions/cache reference is not pinned to a SHA. The "require actions to be pinned to a full-length commit SHA" policy applies to references inside composite actions too, so with the policy on the PSScriptAnalyzer job failed at Set up job before running anything, and that is a required check. Pinning our own reference does not help, the unpinned one is theirs and moves between their releases. The cache is dropped rather than replaced with a pinned actions/cache. The install is 21 seconds measured, the job takes 65 to 92 seconds, and the CI matrix running beside it takes 638 to 743 seconds, so the cache never shortened a run. Frode added the cache and agreed in #3036 that it can go. 🤖 --- .github/workflows/ci.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 817645414..e63f36374 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,10 +181,21 @@ jobs: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: PowerShell Module Cache - uses: potatoqualitee/psmodulecache@9e4b63833c22c1768d648e115a9c849afdda22a5 # v6.3 - with: - modules-to-cache: PSScriptAnalyzer, ConvertToSARIF:1.0.0 + # Installed straight from PSGallery rather than through potatoqualitee/psmodulecache. + # That is a composite action and its own actions/cache reference is not pinned to a SHA. + # The "require actions to be pinned to a full-length commit SHA" policy applies to + # references inside composite actions too, so with the policy on this job failed at Set up + # job before running anything, and PSScriptAnalyzer is a required check (#3036). Pinning our + # own reference does not help, the unpinned one is theirs and moves between their releases. + # + # Dropping the cache rather than replacing it with a pinned actions/cache: the install is + # 21 s measured, this job takes 65-92 s, and the CI matrix beside it takes 638-743 s, so the + # cache never shortened a run. + - name: Install PSScriptAnalyzer and ConvertToSARIF + shell: pwsh + run: | + Install-Module PSScriptAnalyzer -Scope CurrentUser -Force -Repository PSGallery + Install-Module ConvertToSARIF -RequiredVersion 1.0.0 -Scope CurrentUser -Force -Repository PSGallery # Not using microsoft/psscriptanalyzer-action@v1.0 because we're missing psm1 in src + need to exclude generated ps1xml - name: Run PSScriptAnalyzer From ab99a8bf71213fa13243a7a779d6308c093fa2db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 12 Nov 2026 19:17:46 +0100 Subject: [PATCH 2/2] Trim the psmodulecache comment to the part that stays true MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The measured timings were the argument for dropping the cache instead of pinning actions/cache, which is a decision, not something a future reader of the step needs. That argument is in the commit before this one, in the pull request, and in #3036. What stays is the reason not to reach for psmodulecache again. 🤖 --- .github/workflows/ci.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e63f36374..ebafba0f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,15 +182,10 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # Installed straight from PSGallery rather than through potatoqualitee/psmodulecache. - # That is a composite action and its own actions/cache reference is not pinned to a SHA. - # The "require actions to be pinned to a full-length commit SHA" policy applies to - # references inside composite actions too, so with the policy on this job failed at Set up - # job before running anything, and PSScriptAnalyzer is a required check (#3036). Pinning our - # own reference does not help, the unpinned one is theirs and moves between their releases. - # - # Dropping the cache rather than replacing it with a pinned actions/cache: the install is - # 21 s measured, this job takes 65-92 s, and the CI matrix beside it takes 638-743 s, so the - # cache never shortened a run. + # That is a composite action whose own actions/cache reference is not pinned to a SHA, and + # the "require actions to be pinned to a full-length commit SHA" policy applies to + # references inside composite actions too, so this job cannot start while the policy is on. + # Pinning our own reference does not help, the unpinned one is theirs (#3036). - name: Install PSScriptAnalyzer and ConvertToSARIF shell: pwsh run: |