Skip to content

[releases/26.5] Reference repository actions locally and sync them with main - #14040

Closed
Maria Zhelezova (mazhelez) wants to merge 5 commits into
releases/26.5from
mazhelez/use-local-actions-26.5
Closed

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

Conversation

@mazhelez

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

Copy link
Copy Markdown
Contributor

What & why

Backport of #14038 to releases/26.5. Unpinned microsoft/BCApps/.github/actions/<Action>@main references are replaced with local ./.github/actions/<Action> references, so this branch runs its own action code. Actions used by PR checks, and their scripts, now match main.

  • Workflows now reference local actions: SubmitStabilityJobs.yaml, UpdateALGoOnOfficialBranches.yaml, UpdateBCArtifactVersion.yaml, UpdatePackageVersions.yaml, VerifyAppChanges.yaml
  • Scripts synced to main (dependencies of the actions): TestPreprocessorSymbols.psm1
  • Tests synced to main: TestPreprocessorSymbols.Test.ps1

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; every local action path exists. Passed.
  • Synced actions and scripts are identical to main. Passed.
  • Module import and Pester (build/scripts/tests) on 26.4, 27.x, 28.0, 28.x and 29.x. Passed.
  • PR checks on this PR pass.

Risk & compatibility

  • Future changes to these actions on main must be backported.
  • Automation-only actions (RunAutomation, GetGitBranches, ...) are not synced; they run from main.

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

Unresolved defects break AL-Go update dispatch and single-branch matrices, mask PR-creation failures, and admit unsupported branches when API checks fail.

4 open issues
What changed in this PR

Backports #14038 to releases/26.5, replacing remote @main action references with local actions and syncing action code and selected supporting scripts from main.

Changes:

  • Adds checkouts before local actions, including separate sparse checkouts for cross-branch automation jobs.
  • Syncs validation, maintenance, and automation actions while preserving branch-specific build behavior.
  • Adds object-validation and platform-version helpers with Pester coverage.
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 version selection and branch-support checks.
build/​scripts/​BuildOptimization.psm1 Adds change-detection and affected-app 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 action.
.github/​workflows/​UpdatePackageVersions.yaml Runs local actions from a separate checkout.
.github/​workflows/​UpdateBCArtifactVersion.yaml Runs local actions from a separate 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 validation composite.
.github/​actions/​VerifyMiappSync/​action.ps1 Invokes Miapp synchronization validation.
.github/​actions/​ValidateCountryProjects/​action.yaml Defines the country-project validation composite.
.github/​actions/​ValidateCountryProjects/​action.ps1 Invokes country-project settings 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 Defines obsolete-tag validation.
.github/​actions/​TestObsoleteTagPreprocessors/​action.ps1 Checks obsolete-tag preprocessor placement.
.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 enablement automation.
.github/​actions/​RunAutomation/​UpdateSystemFilesSchedule/​run.ps1 Updates schedules to target 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/​UpdateALGo/​run.ps1 Removes the AL-Go update dispatcher.
.github/​actions/​RunAutomation/​SubmitStabilityJob/​run.ps1 Dispatches CI by workflow filename.
.github/​actions/​RunAutomation/​run.ps1 Adds an unsupported-branch guard.
.github/​actions/​RunAutomation/​HowToAddAnAutomation.md Documents local actions and checkout patterns.
.github/​actions/​LabelPRsAwaitingApproval/​action.yaml Defines approval-label synchronization.
.github/​actions/​LabelPRsAwaitingApproval/​action.ps1 Synchronizes labels for runs awaiting approval.
.github/​actions/​GetGitBranches/​action.yaml Adds authentication and pins checkout.
.github/​actions/​GetGitBranches/​action.ps1 Filters 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

Comment thread build/scripts/AutomatedSubmission.psm1 Resolved
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>
@github-actions github-actions Bot removed the Build: scripts & configs Build scripts and configuration files label Nov 18, 2026

@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.
  • 26.x/27.x: Get-LatestBCArtifactUrl -asPattern discards the resolved full build version and returns a floating major/minor pattern, unlike main's version-preserving implementation.
  • 26.x: GetGitBranches does not exclude unsupported branches, and RunAutomation lacks the support guard. Switching to these local copies loses main's protections against running automation on unsupported branches.

@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.

@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.

Bring the actions used on this branch, their build/scripts dependencies and the
touched workflows in line with main (AL-Go managed PullRequestHandler.yaml excluded).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the Build: scripts & configs Build scripts and configuration files label Dec 2, 2026
Alexander Holstrup (aholstrup1) pushed a commit that referenced this pull request Dec 3, 2026
## What & why

Several workflows referenced this repository's own actions as
`microsoft/BCApps/.github/actions/<Action>@main`. Action references must
be pinned to a fixed SHA, and `@main` is not. These references also
always ran `main`'s action code and `build/scripts`, regardless of the
ref the workflow ran on. All third-party actions were already
SHA-pinned; these were the only unpinned references.

This PR switches them to local references
(`./.github/actions/<Action>`):

- `PullRequestHandler`, `SubmitStabilityJobs`,
`AddUnstableTestsFromRun`, `UpdateUnstableTests`,
`UpdateALGoSupportedBranches`: call the local action after the
repository checkout.
- `UpdatePackageVersions`, `UpdateBCArtifactVersion`,
`UpdateALGoProjects`: these matrix jobs check out `matrix.branch`. They
now also sparse-checkout the workflow's own commit (`.github/actions`,
`build/scripts`) into `_actions` and run
`./_actions/.github/actions/RunAutomation`. The automation code still
comes from `main`, as before.
- `HowToAddAnAutomation.md`: examples use local references and pinned
checkouts.

New checkouts use
`actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1`.

The same reference change is made on every in-support release branch:
#14039 (`26.4`), #14040 (`26.5`), #14041 (`26.x`), #14042 (`27.0`),
#14043 (`27.1`), #14044 (`27.2`), #14045 (`27.3`), #14046 (`27.4`),
#14047 (`27.5`), #14048 (`27.x`), #14049 (`28.0`), #14050 (`28.1`),
#14051 (`28.2`), #14052 (`28.3`), #14053 (`28.4`), #14054 (`28.5`),
#14055 (`28.x`), #14056 (`29.0`), #14057 (`29.1`), #14058 (`29.x`). On
those branches, the actions used by workflows that run there (PR checks)
are also aligned with `main`.

## Linked work


[AB#656028](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/656028)

## How I validated this

- [x] 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)*
- [x] 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 under
`.github/` (grep). Passed.
- All changed workflow files parse as YAML. Passed.
- Every local `uses: ./...` path resolves to an existing `action.yaml`,
with a checkout earlier in the same job. Passed.
- Every automation passed to `RunAutomation` exists under
`.github/actions/RunAutomation`. Passed.
- The workflows were not run locally; they run on schedule, dispatch or
PR after merge. No tests added: workflow wiring only.

## Risk & compatibility

- The matrix automation workflows use an extra sparse checkout
(`_actions`).
- Workflows now run the action code from the ref they run on. On release
branches, the PR-check actions are kept identical to `main`; future
changes to them must be backported. Scheduled and dispatched workflows
run from `main` only.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@mazhelez
Maria Zhelezova (mazhelez) requested a balanced review from Copilot December 3, 2026 13:32

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.

🟢 Approval recommended

No active review issues are recorded for the local-action backport and preprocessor validation updates.

No open issues 🎉

4 resolved since last review

Review effort: Balanced

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