Pipelines: exclude .ps1 from CodeSign in package stage#40653
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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: -|**\*.ps1to thepackagejob’svariables:block in.pipelines/package-stage.ymlso the SDL injection applies to the package job scope.
OneBlue
approved these changes
May 27, 2026
| ob_outputDirectory: '$(Build.SourcesDirectory)\out' | ||
| ob_artifactBaseName: 'drop_wsl' | ||
| ob_artifactSuffix: '_package' | ||
| ob_sdl_codeSignValidation_excludes: -|**\*.ps1 |
Collaborator
There was a problem hiding this comment.
nit: I don't think we need -| here since it's a single line string
2 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: -|**\*.ps1as a pipeline-level variable in the threewsl-build-*-onebranch.ymlfiles. However, thepackagejob inpackage-stage.ymldeclares its own job-levelvariables:block, and OneBranch's SDL injection only honorsob_sdl_*variables at job scope — so the pipeline-level value isn't being applied to the package job.PR Checklist
Detailed Description of the PR
Add
ob_sdl_codeSignValidation_excludes: -|**\*.ps1to thepackagejob'svariables:block in.pipelines/package-stage.yml, mirroring whatbuild-job.ymlalready does.Validation Steps
Run the release / nightly pipeline and confirm the package stage's 🛡 Guardian: Post Analysis step no longer reports
CodeSign.MissingSigningCerterrors for in-repo.ps1files.