Repository navigation
[releases/29.1] Reference repository actions locally and sync them with main - #14057
Maria Zhelezova (mazhelez) wants to merge 8 commits into
Conversation
Replace 'microsoft/BCApps/.github/actions/<X>@main' with local './.github/actions/<X>' references so the action code matches the workflow's commit. Jobs without a checkout get one; jobs that check out another branch (matrix.branch) sparse-check out the workflow's own commit into '_actions' and reference the action from there. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Make the code of all repository actions (.github/actions) identical to main so every in-support branch runs the same action versions. Actions import PowerShell modules from build/scripts, so the dependencies needed by the actions are brought in line with main as well: - Modules only consumed by actions are synced as whole files (AutomatedSubmission, AppObjectValidation, BuildOptimization, TestPreprocessorSymbols, PlatformHelper, their tests, and Miapp where VerifyMiappSync is used). - EnlistmentHelperFunctions.psm1 is shared with the build, so only the functions required by the actions are taken from main (Get-PackageLatestVersion, Get-LatestBCArtifactUrl, Update-BCArtifactVersion, Update-PackageVersion, Test-IsBranchInSupport). Build-facing functions are left unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…omRun Avoid interpolating user-controlled values into PowerShell string literals (script injection). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The supported-branches update workflow still executes action and build-script code from the current main tip rather than the dispatched workflow commit, leaving branch dispatches version-inconsistent.
1 open issue
What changed in this PR
Backports #14038 to releases/29.1, replacing remote @main action references with local references and synchronizing supporting automation code with main.
Changes:
- Updates eight workflows to use local actions, adding repository or sparse checkouts where needed.
- Synchronizes object-ID validation, branch-aware baseline updates, and Miapp propagation handling.
- Adds validation tests and updates automation documentation.
| File | Description |
|---|---|
build/scripts/tests/BuildOptimization.Test.ps1 |
Tests added-file filtering with merge-base comparison. |
build/scripts/tests/AppObjectValidation.Test.ps1 |
Adds object-ID range and test-app exclusion tests. |
build/scripts/Miapp/MicroSnapApp.psm1 |
Expands exclusion snapshots during propagation validation. |
build/scripts/Miapp/MicroAppIntegrate.psm1 |
Fixes the country-path matching expression. |
build/scripts/Miapp/MicroAppGitHelper.psm1 |
Honors an existing requested base branch. |
build/scripts/Miapp/.miappsnap/a212b9e3381d8a879c58dfceedaad215f5ebec19.json |
Adds propagation exclusions synchronized from main. |
build/scripts/Miapp/.miappsnap/3fb2e50e99bbbae53257ea0b4e8dc11231e804e0.json |
Adds further synchronized propagation exclusions. |
build/scripts/EnlistmentHelperFunctions.psm1 |
Passes target branches into baseline version selection. |
build/scripts/BuildOptimization.psm1 |
Adds merge-base comparison and required change detection. |
build/scripts/AppObjectValidation.psm1 |
Validates new production object IDs while excluding test apps. |
.github/workflows/UpdateUnstableTests.yaml |
Uses local branch-discovery and test-update actions. |
.github/workflows/UpdatePackageVersions.yaml |
Loads automation through a separate sparse checkout. |
.github/workflows/UpdateBCArtifactVersion.yaml |
Loads artifact-update automation through a sparse checkout. |
.github/workflows/UpdateALGoSupportedBranches.yaml |
Switches RunAutomation to a local reference. |
.github/workflows/UpdateALGoProjects.yaml |
Loads project-update automation through a sparse checkout. |
.github/workflows/SubmitStabilityJobs.yaml |
Adds checkouts before local action execution. |
.github/workflows/PullRequestHandler.yaml |
Uses local validation actions. |
.github/workflows/AddUnstableTestsFromRun.yaml |
Uses local actions and environment-based input passing. |
.github/actions/TestObsoleteTagPreprocessors/action.yaml |
Adds the obsolete-tag validation action definition. |
.github/actions/TestObsoleteTagPreprocessors/action.ps1 |
Adds obsolete-tag checks with fixture exceptions. |
.github/actions/TestObjectIdsAndManifests/action.ps1 |
Applies allowed ID ranges to newly added production files. |
.github/actions/RunAutomation/UpdateAppBaselines/run.ps1 |
Supplies the target branch for baseline selection. |
.github/actions/RunAutomation/run.ps1 |
Updates the work-item link in generated PR descriptions. |
.github/actions/RunAutomation/HowToAddAnAutomation.md |
Documents local actions and SHA-pinned checkout examples. |
Review effort: Balanced
Workflows that only run on schedule/workflow_dispatch execute from main, so the copies of their actions and build scripts are not needed here. Keep only the actions used by workflows that run on this branch (identical to main) and revert the rest to the base branch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
'Layers' exists on release branches from 29.0 onwards. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Release branches use testFolders such as 'src/Apps/W1/*/Test'. Expand these to the matching folders so added files in those test apps are excluded from the object ID range check. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The job runs actions from the PR checkout, so it should not inherit id-token: write and the other workflow-level write permissions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|

What & why
Backport of #14038 to
releases/29.1. Action references must be pinned to a fixed SHA, andmicrosoft/BCApps/.github/actions/<Action>@mainis not. These references also ranmain's action code on this branch.AddUnstableTestsFromRun,PullRequestHandler,SubmitStabilityJobs,UpdateALGoProjects,UpdateALGoSupportedBranches,UpdateBCArtifactVersion,UpdatePackageVersions,UpdateUnstableTestsnow use./.github/actions/<Action>.main.PullRequestHandlerrunsTestObjectIdsAndManifests,TestPreprocessorSymbols,ValidateCountryProjects,VerifyMiappSyncon this branch. Local actions use this branch'sbuild/scripts, so these were updated tomain's version:.github/actions/TestObjectIdsAndManifestsbuild/scripts/AppObjectValidation.psm1build/scripts/BuildOptimization.psm1build/scripts/Miapp/MicroAppGitHelper.psm1build/scripts/Miapp/MicroAppIntegrate.psm1build/scripts/Miapp/MicroSnapApp.psm1build/scripts/tests/AppObjectValidation.Test.ps1build/scripts/tests/BuildOptimization.Test.ps1AddUnstableTestsFromRun,SubmitStabilityJobs,UpdateALGoProjects,UpdateALGoSupportedBranches,UpdateBCArtifactVersion,UpdatePackageVersions,UpdateUnstableTestsonly run onschedule/workflow_dispatch, so in practice they run frommain(scheduled runs only fire on the default branch). Their references are localized here for consistency, but the actions they use (RunAutomation,GetGitBranches, ...) are left at this branch's version and are not synced.Linked work
AB#656028
Relates to #14038.
How I validated this
What I tested and the outcome
microsoft/BCApps/.github/actions/*@...references remain in workflows; changed workflows parse as YAML; every local action path exists. Passed.TestObjectIdsAndManifests,TestPreprocessorSymbols,ValidateCountryProjects,VerifyMiappSynctrees equalmain's, and every module they import exists on this branch. Passed.build/scripts/tests) on a full export of29.xfrom this set of PRs. Passed.Risk & compatibility
mainmust be backported.