Skip to content

Pipelines: exclude .ps1 from CodeSign in package stage#40653

Merged
benhillis merged 1 commit into
masterfrom
fix/package-stage-codesign-ps1-exclude
May 27, 2026
Merged

Pipelines: exclude .ps1 from CodeSign in package stage#40653
benhillis merged 1 commit into
masterfrom
fix/package-stage-codesign-ps1-exclude

Conversation

@benhillis
Copy link
Copy Markdown
Member

Summary

The Guardian CodeSign post-analysis in the package job (build 147884488) is failing on in-repo .ps1 scripts (diagnostics/collect-wsl-logs.ps1, tools/deploy/*.ps1, triage/install-latest-wsl.ps1, etc.) that are not shipped and don't need signing.

PR #40541 fixed this for the build job and added ob_sdl_codeSignValidation_excludes: -|**\*.ps1 as a pipeline-level variable in the three wsl-build-*-onebranch.yml files. However, the package job in package-stage.yml declares its own job-level variables: block, and OneBranch's SDL injection only honors ob_sdl_* variables at job scope — so the pipeline-level value isn't being applied to the package job.

PR Checklist

  • Issue exists in the WSL repo for this change
  • Validation steps below

Detailed Description of the PR

Add ob_sdl_codeSignValidation_excludes: -|**\*.ps1 to the package job's variables: block in .pipelines/package-stage.yml, mirroring what build-job.yml already does.

Validation Steps

Run the release / nightly pipeline and confirm the package stage's 🛡 Guardian: Post Analysis step no longer reports CodeSign.MissingSigningCert errors for in-repo .ps1 files.

The Guardian CodeSign post-analysis in the package job is failing on
in-repo .ps1 scripts (collect-wsl-logs.ps1, deploy/*.ps1, etc.) that
are not shipped and don't need signing.

PR #40541 fixed this for the build job and added the exclusion as a
pipeline-level variable, but the package job in package-stage.yml
declares its own variables block and OneBranch's SDL injection only
honors ob_sdl_* variables at job scope, so the pipeline-level value
isn't applied.

Add ob_sdl_codeSignValidation_excludes: -|**\*.ps1 to the package job's
variables, mirroring what build-job.yml does.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 27, 2026 15:58
@benhillis benhillis requested a review from a team as a code owner May 27, 2026 15:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the WSL OneBranch packaging pipeline to exclude in-repo PowerShell scripts (.ps1) from Guardian CodeSign post-analysis in the package job, avoiding false-positive CodeSign.MissingSigningCert failures for scripts that aren’t shipped.

Changes:

  • Add ob_sdl_codeSignValidation_excludes: -|**\*.ps1 to the package job’s variables: block in .pipelines/package-stage.yml so the SDL injection applies to the package job scope.

ob_outputDirectory: '$(Build.SourcesDirectory)\out'
ob_artifactBaseName: 'drop_wsl'
ob_artifactSuffix: '_package'
ob_sdl_codeSignValidation_excludes: -|**\*.ps1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I don't think we need -| here since it's a single line string

@benhillis benhillis merged commit df4963c into master May 27, 2026
12 checks passed
@benhillis benhillis deleted the fix/package-stage-codesign-ps1-exclude branch May 27, 2026 17:59
benhillis pushed a commit that referenced this pull request May 27, 2026
The Guardian CodeSign post-analysis scans the entire source checkout and
flags every in-repo .ps1 as unsigned (17 errors, breaking the release
build). Two prior attempts to filter the findings via the documented
ob_sdl_codeSignValidation_excludes variable - at pipeline-level
(b011cf7) and at the package job's variables block (PR #40653) - were
both silently ignored.

Disable the auto-scan on the package job; the msixbundle and nupkg
outputs are explicitly signed AND verified by the EsrpCodeSigning tasks
in the same job (SigntoolVerify / NuGetVerify operations), so signing
coverage on the actual release artifacts is preserved. The build_x64 /
build_arm64 jobs keep codesign validation enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
benhillis added a commit that referenced this pull request May 28, 2026
The Guardian CodeSign post-analysis scans the entire source checkout and
flags every in-repo .ps1 as unsigned (17 errors, breaking the release
build). Two prior attempts to filter the findings via the documented
ob_sdl_codeSignValidation_excludes variable - at pipeline-level
(b011cf7) and at the package job's variables block (PR #40653) - were
both silently ignored.

Disable the auto-scan on the package job; the msixbundle and nupkg
outputs are explicitly signed AND verified by the EsrpCodeSigning tasks
in the same job (SigntoolVerify / NuGetVerify operations), so signing
coverage on the actual release artifacts is preserved. The build_x64 /
build_arm64 jobs keep codesign validation enabled.

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants