Repository navigation
[releases/26.4] Reference repository actions locally and sync them with main - #14039
Maria Zhelezova (mazhelez) wants to merge 4 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>
| $ProgressPreference = 'SilentlyContinue' | ||
| Set-StrictMode -Version 2.0 | ||
|
|
||
| $scriptsRoot = Join-Path $PSScriptRoot '..' '..' '..' 'build' 'scripts' 'TestTolerance' |
| throw "Platform version '$Version' is not available. Use Get-PlatformVersions to see available versions." | ||
| } | ||
|
|
||
| return "$script:PlatformCdnUrl/platform/$Version" |
| return $resolvedVersion | ||
| } | ||
|
|
||
| return $Version |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Critical defects can prevent update dispatch, break single-branch matrices, bypass support checks after API failures, and silently report success when PR creation fails.
5 open issues
Single-branch filtering serializes as a string, not an array · New Workflow references deleted UpdateALGo automation · New Auto-merge suppression hides pull request creation failures · New Failed GitHub API calls incorrectly mark branches as supported · New GitHub CLI failures are not checked or retried · New
What changed in this PR
Backports #14038 to releases/26.4, replacing floating repository action references with local actions and aligning their supporting scripts with main.
Changes:
- Switches five workflows to local actions, adding checkouts where needed.
- Synchronizes action implementations, including branch-support filtering, validation, and maintenance automation.
- Adds validation and platform helper modules with tests, while leaving build-facing scripts and AL-Go settings unchanged.
| File | Description |
|---|---|
build/scripts/tests/PlatformHelper.Test.ps1 |
Tests platform lookup and caching. |
build/scripts/tests/AppObjectValidation.Test.ps1 |
Tests object ranges and test-app exclusions. |
build/scripts/PlatformHelper.psm1 |
Adds platform version lookup helpers. |
build/scripts/EnlistmentHelperFunctions.psm1 |
Updates package, artifact, and branch-support helpers. |
build/scripts/BuildOptimization.psm1 |
Adds change-detection and dependency helpers. |
build/scripts/AutomatedSubmission.psm1 |
Makes auto-merge failures nonfatal. |
build/scripts/AppObjectValidation.psm1 |
Adds object and manifest validation helpers. |
.github/workflows/VerifyAppChanges.yaml |
Uses the local preprocessor validation action. |
.github/workflows/UpdatePackageVersions.yaml |
Uses local actions with a separate automation checkout. |
.github/workflows/UpdateBCArtifactVersion.yaml |
Uses local actions with a separate automation checkout. |
.github/workflows/UpdateALGoOnOfficialBranches.yaml |
Adds checkouts and local action references. |
.github/workflows/SubmitStabilityJobs.yaml |
Adds checkouts and local action references. |
.github/actions/VerifyMiappSync/action.yaml |
Defines the Miapp synchronization action. |
.github/actions/VerifyMiappSync/action.ps1 |
Invokes Miapp synchronization verification. |
.github/actions/ValidateCountryProjects/action.yaml |
Defines country-project validation. |
.github/actions/ValidateCountryProjects/action.ps1 |
Invokes country settings validation. |
.github/actions/UpdateUnstableTestsCombined/action.yaml |
Defines combined unstable-test maintenance and upload. |
.github/actions/UpdateUnstableTestsCombined/action.ps1 |
Invokes combined detection and exposes artifact output. |
.github/actions/UpdateUnstableTests/action.yaml |
Defines run-based unstable-test maintenance. |
.github/actions/UpdateUnstableTests/action.ps1 |
Updates unstable-test artifacts from supplied runs. |
.github/actions/TestObsoleteTagPreprocessors/action.yaml |
Defines obsolete-tag preprocessor validation. |
.github/actions/TestObsoleteTagPreprocessors/action.ps1 |
Checks obsolete tags with fixture exceptions. |
.github/actions/TestObjectIdsAndManifests/action.yaml |
Defines object and manifest validation. |
.github/actions/TestObjectIdsAndManifests/action.ps1 |
Configures validation scopes, ranges, and exceptions. |
.github/actions/RunAutomation/UpdateUseProjectDependencies/run.ps1 |
Adds project-dependency settings automation. |
.github/actions/RunAutomation/UpdateSystemFilesSchedule/run.ps1 |
Restricts scheduled updates to supported branches. |
.github/actions/RunAutomation/UpdatePlatformVersion/run.ps1 |
Adds platform-package update automation. |
.github/actions/RunAutomation/UpdateAppBaselines/run.ps1 |
Passes the target branch to baseline lookup. |
.github/actions/RunAutomation/UpdateALGo/run.ps1 |
Removes the legacy AL-Go dispatcher. |
.github/actions/RunAutomation/SubmitStabilityJob/run.ps1 |
Dispatches stability builds by workflow filename. |
.github/actions/RunAutomation/run.ps1 |
Adds a branch-support guard and updates work-item linkage. |
.github/actions/RunAutomation/HowToAddAnAutomation.md |
Documents local actions and supported-branch behavior. |
.github/actions/LabelPRsAwaitingApproval/action.yaml |
Defines approval-label synchronization inputs. |
.github/actions/LabelPRsAwaitingApproval/action.ps1 |
Synchronizes labels for runs awaiting approval. |
.github/actions/GetGitBranches/action.yaml |
Adds token input and pins checkout. |
.github/actions/GetGitBranches/action.ps1 |
Filters discovered branches by support status. |
.github/actions/CleanUpStalePRChecks/action.yaml |
Defines stale-check cleanup inputs. |
.github/actions/CleanUpStalePRChecks/action.ps1 |
Deletes stale runs and posts recovery instructions. |
Review effort: Balanced
| } | ||
|
|
||
| Write-Host "Git branches: $($branches -join ', ')" | ||
| $branches = $branches | Where-Object { Test-IsBranchInSupport -BranchName $_ -Repository $ENV:GITHUB_REPOSITORY } |
| # Enabling auto-merge can fail due repository configuration or transient GitHub API issues. | ||
| # A PR has already been created at this point, so the automation should continue. | ||
| $mergeOutput = @(gh pr merge --auto --squash 2>&1) |
| [string] $Repository | ||
| ) | ||
| $isSupported = $true | ||
| $rulesets = gh api "/repos/$Repository/rules/branches/$BranchName" | ConvertFrom-Json |
| else { | ||
| # Delete the workflow run | ||
| Invoke-CommandWithRetry -ScriptBlock { | ||
| gh run delete $runId -R $env:GITHUB_REPOSITORY | Out-Null |
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>
spetersenms
left a comment
There was a problem hiding this comment.
The action/helper synchronization described in these PRs is incomplete:
- 26.x-28.x:
GetGitBranches/action.yamlstill uses unpinnedactions/checkout@v4. Pinning the outer checkout does not cover this nested checkout. - 26.x/27.x:
Get-LatestBCArtifactUrl -asPatterndiscards the resolved full build version and returns a floating major/minor pattern, unlike main's version-preserving implementation. - 26.x:
GetGitBranchesdoes not exclude unsupported branches, andRunAutomationlacks the support guard. Switching to these local copies loses main's protections against running automation on unsupported branches.
|
|


What & why
Backport of #14038 to
releases/26.4. 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.SubmitStabilityJobs,UpdateALGoOnOfficialBranches,UpdateBCArtifactVersion,UpdatePackageVersions,VerifyAppChangesnow use./.github/actions/<Action>.VerifyAppChangesrunsTestPreprocessorSymbols, which (with its importedbuild/scripts) is already identical tomainon this branch, so no action code changes are needed.SubmitStabilityJobs,UpdateALGoOnOfficialBranches,UpdateBCArtifactVersion,UpdatePackageVersionsonly 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.TestPreprocessorSymbolsand itsbuild/scriptsimports are identical tomain(tree/blob hash). Passed.build/scripts/tests) on a full export of26.4from this set of PRs. Passed.Risk & compatibility
mainmust be backported.