Skip to content

[releases/28.1] Reference repository actions locally and sync them with main - #14050

Open
Maria Zhelezova (mazhelez) wants to merge 6 commits into
releases/28.1from
mazhelez/use-local-actions-28.1
Open

Maria Zhelezova (mazhelez) wants to merge 6 commits into
releases/28.1from
mazhelez/use-local-actions-28.1

Conversation

@mazhelez

@mazhelez Maria Zhelezova (mazhelez) commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Backport of #14038 to releases/28.1. Action references must be pinned to a fixed SHA, and microsoft/BCApps/.github/actions/<Action>@main is not. These references also ran main's action code on this branch.

  1. Local action references. SubmitStabilityJobs, UpdateALGoProjects, UpdateBCArtifactVersion, UpdatePackageVersions, VerifyAppChanges now use ./.github/actions/<Action>.
  2. PR-check actions identical to main. VerifyAppChanges runs TestObjectIdsAndManifests, TestPreprocessorSymbols on this branch. Local actions use this branch's build/scripts, so these were updated to main's version:
    • .github/actions/TestObjectIdsAndManifests
    • build/scripts/AppObjectValidation.psm1
    • build/scripts/BuildOptimization.psm1
    • build/scripts/tests/AppObjectValidation.Test.ps1

SubmitStabilityJobs, UpdateALGoProjects, UpdateBCArtifactVersion, UpdatePackageVersions only run on schedule/workflow_dispatch, so in practice they run from main (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

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings. (N/A: no AL changes)
  • I ran the change in Business Central and confirmed it behaves as expected. (N/A: workflow and script changes only)
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • No microsoft/BCApps/.github/actions/*@... references remain in workflows; changed workflows parse as YAML; every local action path exists. Passed.
  • TestObjectIdsAndManifests, TestPreprocessorSymbols trees equal main's, and every module they import exists on this branch. Passed.
  • Pester (build/scripts/tests) on a full export of 28.x from this set of PRs. Passed.
  • The workflows were not run locally.

Risk & compatibility

  • PR checks on this branch now run this branch's copy of the actions; future changes to them on main must be backported.
  • Build-facing scripts are unchanged.

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>
@mazhelez
Maria Zhelezova (mazhelez) requested a review from a team November 13, 2026 14:01
@github-actions github-actions Bot added Build: Automation Workflows and other setup in .github folder Build: scripts & configs Build scripts and configuration files Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction Team: Other GitHub request for other area than SCM, Finance or Integration labels Nov 13, 2026
Comment thread build/scripts/PlatformHelper.psm1 Fixed
Comment thread build/scripts/PlatformHelper.psm1 Fixed
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical issues can let automation report success without creating a PR and incorrectly reject helper-app objects because configured wildcard paths are not expanded.

2 open issues
What changed in this PR

Backports #14038 to releases/28.1, replacing remote @main action references with checked-out local actions and synchronizing action code and supporting modules with main.

Changes:

  • Updates five workflows to use local actions, with separate sparse checkouts for matrix automation jobs.
  • Synchronizes validation, automation, and maintenance actions while preserving branch-specific build behavior.
  • Adds platform-version helpers, object-validation enhancements, and Pester coverage.
File Description
build/​scripts/​tests/​PlatformHelper.Test.ps1 Tests platform lookup and caching.
build/​scripts/​tests/​AppObjectValidation.Test.ps1 Tests ID ranges and test-app exclusions.
build/​scripts/​PlatformHelper.psm1 Adds platform-version lookup helpers.
build/​scripts/​EnlistmentHelperFunctions.psm1 Updates package selection and version handling.
build/​scripts/​BuildOptimization.psm1 Adds change detection and dependency helpers.
build/​scripts/​AutomatedSubmission.psm1 Makes auto-merge failures non-fatal.
build/​scripts/​AppObjectValidation.psm1 Expands manifest and object-ID validation.
.github/​workflows/​VerifyAppChanges.yaml Uses local validation actions.
.github/​workflows/​UpdatePackageVersions.yaml Checks out local package-update actions.
.github/​workflows/​UpdateBCArtifactVersion.yaml Checks out local artifact-update actions.
.github/​workflows/​UpdateALGoProjects.yaml Checks out local dependency-update actions.
.github/​workflows/​SubmitStabilityJobs.yaml Uses local stability automation.
.github/​actions/​VerifyMiappSync/​action.yaml Adds the Miapp validation action definition.
.github/​actions/​VerifyMiappSync/​action.ps1 Adds the Miapp validation entry point.
.github/​actions/​ValidateCountryProjects/​action.yaml Adds the country-project validation action.
.github/​actions/​ValidateCountryProjects/​action.ps1 Invokes country-project validation.
.github/​actions/​UpdateUnstableTestsCombined/​action.yaml Defines combined unstable-test updates and uploads.
.github/​actions/​UpdateUnstableTestsCombined/​action.ps1 Invokes the combined unstable-test updater.
.github/​actions/​UpdateUnstableTests/​action.yaml Defines run-based unstable-test updates and uploads.
.github/​actions/​UpdateUnstableTests/​action.ps1 Invokes the run-based unstable-test updater.
.github/​actions/​TestObsoleteTagPreprocessors/​action.yaml Adds the obsolete-tag validation action.
.github/​actions/​TestObsoleteTagPreprocessors/​action.ps1 Checks obsolete-tag preprocessor compliance.
.github/​actions/​TestObjectIdsAndManifests/​action.ps1 Updates validation scopes, exceptions, and added-file checks.
.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 into baseline selection.
.github/​actions/​RunAutomation/​SubmitStabilityJob/​run.ps1 Dispatches stability builds by workflow filename.
.github/​actions/​RunAutomation/​run.ps1 Skips unsupported branches and updates work-item linkage.
.github/​actions/​RunAutomation/​HowToAddAnAutomation.md Documents local actions and pinned checkouts.
.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 Pins its checkout action to a SHA.
.github/​actions/​CleanUpStalePRChecks/​action.ps1 Handles unknown mergeability and improves cleanup reporting.

Review effort: Balanced

Comment thread build/scripts/AppObjectValidation.psm1 Resolved
Comment thread build/scripts/AutomatedSubmission.psm1 Outdated
Comment on lines +155 to +158

# 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)
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 spetersenms left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The action/helper synchronization described in these PRs is incomplete:

  • 26.x-28.x: GetGitBranches/action.yaml still uses unpinned actions/checkout@v4. Pinning the outer checkout does not cover this nested checkout.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

'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>
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

This branch was previously deployed

1 inactive (outdated) deployment
triage — 78f114a3 Deployed Nov 23, 2026 by mazhelez via Classify team ownership #11813
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build: Automation Workflows and other setup in .github folder Build: scripts & configs Build scripts and configuration files Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction Team: Other GitHub request for other area than SCM, Finance or Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants