Copilot instructions
.github/instructions/onebranch-signing-configuration.instructions.mdCopilot instructions
Quality
62/100
Scores the file, not the repository.Length
746 words
15 headings · 6 code blocksRepository
55k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# OneBranch Signing Configuration89This guide explains how to configure OneBranch signing variables in Azure Pipeline jobs, particularly when signing is not required.1011## Purpose1213OneBranch pipelines include signing infrastructure by default. For build-only jobs where signing happens in a separate stage, you should disable signing setup to improve performance and avoid unnecessary overhead.1415## Disable Signing for Build-Only Jobs1617When a job does not perform signing (e.g., it only builds artifacts that will be signed in a later stage), disable both signing setup and code sign validation:1819```yaml20variables:21 - name: ob_signing_setup_enabled22 value: false # Disable signing setup - this is a build-only stage23 - name: ob_sdl_codeSignValidation_enabled24 value: false # Skip signing validation in build-only stage25```2627### Why Disable These Variables?2829**`ob_signing_setup_enabled: false`**30- Prevents OneBranch from setting up the signing infrastructure31- Reduces job startup time32- Avoids unnecessary credential validation33- Only disable when the job will NOT sign any artifacts3435**`ob_sdl_codeSignValidation_enabled: false`**36- Skips validation that checks if files are properly signed37- Appropriate for build stages where artifacts are unsigned38- Must be enabled in signing/release stages to validate signatures3940## Common Patterns4142### Build-Only Job (No Signing)4344```yaml45jobs:46- job: build_artifacts47 variables:48 - name: ob_signing_setup_enabled49 value: false50 - name: ob_sdl_codeSignValidation_enabled51 value: false52 steps:53 - checkout: self54 - pwsh: |55 # Build unsigned artifacts56 Start-PSBuild57```5859### Signing Job6061```yaml62jobs:63- job: sign_artifacts64 variables:65 - name: ob_signing_setup_enabled66 value: true67 - name: ob_sdl_codeSignValidation_enabled68 value: true69 steps:70 - checkout: self71 env:72 ob_restore_phase: true # Steps before first signing operation73 - pwsh: |74 # Prepare artifacts for signing75 env:76 ob_restore_phase: true # Steps before first signing operation77 - task: onebranch.pipeline.signing@178 displayName: 'Sign artifacts'79 # Signing step runs in build phase (no ob_restore_phase)80 - pwsh: |81 # Post-signing validation82 # Post-signing steps run in build phase (no ob_restore_phase)83```8485## Restore Phase Usage with Signing8687**The restore phase (`ob_restore_phase: true`) should only be used in jobs that perform signing operations.** It separates preparation steps from the actual signing and build steps.8889### When to Use Restore Phase9091Use `ob_restore_phase: true` **only** in jobs where `ob_signing_setup_enabled: true`:9293```yaml94jobs:95- job: sign_artifacts96 variables:97 - name: ob_signing_setup_enabled98 value: true # Signing enabled99 steps:100 # Steps BEFORE first signing operation: use restore phase101 - checkout: self102 env:103 ob_restore_phase: true104 - template: prepare-for-signing.yml105 parameters:106 ob_restore_phase: true107108 # SIGNING STEP: runs in build phase (no ob_restore_phase)109 - task: onebranch.pipeline.signing@1110 displayName: 'Sign artifacts'111112 # Steps AFTER signing: run in build phase (no ob_restore_phase)113 - pwsh: |114 # Validation or packaging115```116117### When NOT to Use Restore Phase118119**Do not use restore phase in build-only jobs** where `ob_signing_setup_enabled: false`:120121```yaml122jobs:123- job: build_artifacts124 variables:125 - name: ob_signing_setup_enabled126 value: false # No signing127 - name: ob_sdl_codeSignValidation_enabled128 value: false129 steps:130 - checkout: self131 # NO ob_restore_phase - not needed without signing132 - pwsh: |133 Start-PSBuild134```135136**Why?** The restore phase is part of OneBranch's signing infrastructure. Using it without signing enabled adds unnecessary overhead without benefit.137138## Related Variables139140Other OneBranch signing-related variables:141142- `ob_sdl_binskim_enabled`: Controls BinSkim security analysis (can be false in build-only, true in signing stages)143144## Best Practices1451461. **Separate build and signing stages**: Build artifacts in one job, sign in another1472. **Disable signing in build stages**: Improves performance and clarifies intent1483. **Only use restore phase with signing**: The restore phase should only be used in jobs where signing is enabled (`ob_signing_setup_enabled: true`)1494. **Restore phase before first signing step**: All steps before the first signing operation should use `ob_restore_phase: true`1505. **Always validate after signing**: Enable validation in signing stages to catch issues1516. **Document the reason**: Add comments explaining why signing is disabled or why restore phase is used152153## Example: Split Build and Sign Pipeline154155```yaml156stages:157 - stage: Build158 jobs:159 - job: build_windows160 variables:161 - name: ob_signing_setup_enabled162 value: false # Build-only, no signing163 - name: ob_sdl_codeSignValidation_enabled164 value: false # Artifacts are unsigned165 steps:166 - template: templates/build-unsigned.yml167168 - stage: Sign169 dependsOn: Build170 jobs:171 - job: sign_windows172 variables:173 - name: ob_signing_setup_enabled174 value: true # Enable signing infrastructure175 - name: ob_sdl_codeSignValidation_enabled176 value: true # Validate signatures177 steps:178 - template: templates/sign-artifacts.yml179```180181## Troubleshooting182183**Job fails with signing-related errors but signing is disabled:**184- Verify `ob_signing_setup_enabled: false` is set in variables185- Check that no template is overriding the setting186- Ensure `ob_sdl_codeSignValidation_enabled: false` is also set187188**Signed artifacts fail validation:**189- Confirm `ob_sdl_codeSignValidation_enabled: true` in signing job190- Verify signing actually occurred191- Check certificate configuration192193## Reference194195- PowerShell signing templates: `.pipelines/templates/packaging/windows/sign.yml`196
Also in PowerShell/PowerShell
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| PowerShell/PowerShell.github/instructions/code-review-branch-strategy.instructions.md · 55k | Copilot instructions | lint-formatstyletypesgit+1 | 62/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/instruction-file-format.instructions.md · 55k | Copilot instructions | buildlint-formatstylearch+3 | 76/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/pester-set-itresult-pattern.instructions.md · 55k | Copilot instructions | setupstylearch | 62/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-automatic-variables.instructions.md · 55k | Copilot instructions | stylearchgitdeployment+1 | 69/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/pester-test-status-and-working-meaning.instructions.md · 55k | Copilot instructions | teststyle | 54/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/build-and-packaging-steps.instructions.md · 55k | Copilot instructions | buildagent-behaviour | 58/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/build-checkout-prerequisites.instructions.md · 55k | Copilot instructions | setupbuildstylearch+1 | 81/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/build-configuration-guide.instructions.md · 55k | Copilot instructions | buildteststyletesting-strategy+2 | 74/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/log-grouping-guidelines.instructions.md · 55k | Copilot instructions | buildtestdo-not | 77/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-condition-syntax.instructions.md · 55k | Copilot instructions | buildstylearchdeployment+1 | 73/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-restore-phase-pattern.instructions.md · 55k | Copilot instructions | arch | 54/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-module-organization.instructions.md · 55k | Copilot instructions | buildteststylearch+2 | 69/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-parameter-naming.instructions.md · 55k | Copilot instructions | styledo-not | 65/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/publishing-pester-result.instructions.md · 55k | Copilot instructions | testlint-formatstylearch+3 | 69/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/script-module-file-format.instructions.md · 55k | Copilot instructions | lint-format | 54/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/start-native-execution.instructions.md · 55k | Copilot instructions | buildstylearchgit+1 | 86/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/start-psbuild-basics.instructions.md · 55k | Copilot instructions | buildtesting-strategydeploymentagent-behaviour | 54/100 | 3 days ago | |
| PowerShell/PowerShell.github/instructions/troubleshooting-builds.instructions.md · 55k | Copilot instructions | buildgitdeployment | 54/100 | 3 days ago |
Diff against .github/instructions/code-review-branch-strategy.instructions.md Diff against .github/instructions/instruction-file-format.instructions.md Diff against .github/instructions/pester-set-itresult-pattern.instructions.md Diff against .github/instructions/powershell-automatic-variables.instructions.md Diff against .github/instructions/pester-test-status-and-working-meaning.instructions.md Diff against .github/instructions/build-and-packaging-steps.instructions.md Diff against .github/instructions/build-checkout-prerequisites.instructions.md Diff against .github/instructions/build-configuration-guide.instructions.md Diff against .github/instructions/log-grouping-guidelines.instructions.md Diff against .github/instructions/onebranch-condition-syntax.instructions.md Diff against .github/instructions/onebranch-restore-phase-pattern.instructions.md Diff against .github/instructions/powershell-module-organization.instructions.md Diff against .github/instructions/powershell-parameter-naming.instructions.md Diff against .github/instructions/publishing-pester-result.instructions.md Diff against .github/instructions/script-module-file-format.instructions.md Diff against .github/instructions/start-native-execution.instructions.md Diff against .github/instructions/start-psbuild-basics.instructions.md Diff against .github/instructions/troubleshooting-builds.instructions.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 3 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | 3 days ago | |
| dotnet/roslyn.github/copilot-instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 97/100 | 3 days ago | |
| rtk-ai/rtk.github/copilot-instructions.md · 75k | Copilot instructions | buildtestlint-formatstyle+2 | 97/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 2 days ago |
