From 9c737bdc5cd228e4cf10db9a108de76dbdece0a1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 09:28:24 +0000 Subject: [PATCH 01/10] Initial plan From d9f710ac61c12fed9baee99022b51b9e63126706 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 09:32:34 +0000 Subject: [PATCH 02/10] Add check to skip delivery when no app artifacts exist Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- Actions/Deliver/Deliver.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Actions/Deliver/Deliver.ps1 b/Actions/Deliver/Deliver.ps1 index a20ed3111f..70896e0ee3 100644 --- a/Actions/Deliver/Deliver.ps1 +++ b/Actions/Deliver/Deliver.ps1 @@ -175,6 +175,16 @@ foreach ($thisProject in $sortedProjectList) { Write-Host "- $($_.Name)" } + # Check if there are any app artifacts to deliver + $appArtifactsExist = @(Get-ChildItem -Path (Join-Path $artifactsFolder "$project-$refname-Apps-*.*.*.*") -Directory -ErrorAction SilentlyContinue).Count -gt 0 + if (-not $appArtifactsExist) { + Write-Host "No app artifacts found for project '$project'. Skipping delivery." + if ($artifactsFolderCreated) { + Remove-Item $artifactsFolder -Recurse -Force + } + continue + } + # Check if there is a custom script to run for the delivery target # Use Get-ChildItem to support Linux (case sensitive filenames) as well as Windows $customScript = Get-ChildItem -Path (Join-Path $baseFolder '.github') | Where-Object { $_.Name -eq "DeliverTo$deliveryTarget.ps1" } | ForEach-Object { $_.FullName } From 1570115f16d33882c05b70b34197520e3c07808b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:32:27 +0000 Subject: [PATCH 03/10] Add skip logic to Deploy action and update release notes Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- Actions/Deploy/Deploy.ps1 | 6 ++++++ RELEASENOTES.md | 1 + 2 files changed, 7 insertions(+) diff --git a/Actions/Deploy/Deploy.ps1 b/Actions/Deploy/Deploy.ps1 index 7851dcd5c0..607df445dc 100644 --- a/Actions/Deploy/Deploy.ps1 +++ b/Actions/Deploy/Deploy.ps1 @@ -91,6 +91,12 @@ $apps | ForEach-Object { Write-Host "- $([System.IO.Path]::GetFileName($_))" } +# Check if there are any apps to deploy +if ($apps.Count -eq 0) { + Write-Host "No apps found to deploy to environment '$environmentName'. Skipping deployment." + exit +} + if ($deploymentSettings.DependencyInstallMode -ne "ignore") { Write-Host "Dependencies to $($deploymentSettings.DependencyInstallMode)" if ($dependencies) { diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 1f7b9dec70..5613e8ee1f 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,6 +1,7 @@ ### Issues - Issue 1915 CICD fails on releases/26.x branch - '26.x' cannot be recognized as a semantic version string +- Deliver and Deploy actions now skip execution when no app artifacts are found, preventing errors on initial commits ## v8.2 From 9596e4e01515fb90f0552779ce5fc8f4e01e640b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:33:29 +0000 Subject: [PATCH 04/10] Make exit code explicit in Deploy action Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- Actions/Deploy/Deploy.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Actions/Deploy/Deploy.ps1 b/Actions/Deploy/Deploy.ps1 index 607df445dc..4a69b0630c 100644 --- a/Actions/Deploy/Deploy.ps1 +++ b/Actions/Deploy/Deploy.ps1 @@ -94,7 +94,7 @@ $apps | ForEach-Object { # Check if there are any apps to deploy if ($apps.Count -eq 0) { Write-Host "No apps found to deploy to environment '$environmentName'. Skipping deployment." - exit + exit 0 } if ($deploymentSettings.DependencyInstallMode -ne "ignore") { From 67494a5f3f943f2725a987ead26551525ef5a5f8 Mon Sep 17 00:00:00 2001 From: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:06:22 +0100 Subject: [PATCH 05/10] Refactor delivery and deployment workflows to skip steps when no app artifacts are found --- Actions/Deliver/Deliver.ps1 | 10 ---------- Actions/Deploy/Deploy.ps1 | 6 ------ Templates/AppSource App/.github/workflows/CICD.yaml | 2 ++ .../Per Tenant Extension/.github/workflows/CICD.yaml | 2 ++ 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/Actions/Deliver/Deliver.ps1 b/Actions/Deliver/Deliver.ps1 index 70896e0ee3..a20ed3111f 100644 --- a/Actions/Deliver/Deliver.ps1 +++ b/Actions/Deliver/Deliver.ps1 @@ -175,16 +175,6 @@ foreach ($thisProject in $sortedProjectList) { Write-Host "- $($_.Name)" } - # Check if there are any app artifacts to deliver - $appArtifactsExist = @(Get-ChildItem -Path (Join-Path $artifactsFolder "$project-$refname-Apps-*.*.*.*") -Directory -ErrorAction SilentlyContinue).Count -gt 0 - if (-not $appArtifactsExist) { - Write-Host "No app artifacts found for project '$project'. Skipping delivery." - if ($artifactsFolderCreated) { - Remove-Item $artifactsFolder -Recurse -Force - } - continue - } - # Check if there is a custom script to run for the delivery target # Use Get-ChildItem to support Linux (case sensitive filenames) as well as Windows $customScript = Get-ChildItem -Path (Join-Path $baseFolder '.github') | Where-Object { $_.Name -eq "DeliverTo$deliveryTarget.ps1" } | ForEach-Object { $_.FullName } diff --git a/Actions/Deploy/Deploy.ps1 b/Actions/Deploy/Deploy.ps1 index 4a69b0630c..7851dcd5c0 100644 --- a/Actions/Deploy/Deploy.ps1 +++ b/Actions/Deploy/Deploy.ps1 @@ -91,12 +91,6 @@ $apps | ForEach-Object { Write-Host "- $([System.IO.Path]::GetFileName($_))" } -# Check if there are any apps to deploy -if ($apps.Count -eq 0) { - Write-Host "No apps found to deploy to environment '$environmentName'. Skipping deployment." - exit 0 -} - if ($deploymentSettings.DependencyInstallMode -ne "ignore") { Write-Host "Dependencies to $($deploymentSettings.DependencyInstallMode)" if ($dependencies) { diff --git a/Templates/AppSource App/.github/workflows/CICD.yaml b/Templates/AppSource App/.github/workflows/CICD.yaml index d7711b4a1d..10e84f2ac8 100644 --- a/Templates/AppSource App/.github/workflows/CICD.yaml +++ b/Templates/AppSource App/.github/workflows/CICD.yaml @@ -338,6 +338,7 @@ jobs: - name: Deploy to Business Central id: Deploy + if: hashFiles('.artifacts/**/*.app') != '' uses: microsoft/AL-Go-Actions/Deploy@main env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' @@ -391,6 +392,7 @@ jobs: getSecrets: '${{ matrix.deliveryTarget }}Context' - name: Deliver + if: hashFiles('.artifacts/**/*.app') != '' uses: microsoft/AL-Go-Actions/Deliver@main env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' diff --git a/Templates/Per Tenant Extension/.github/workflows/CICD.yaml b/Templates/Per Tenant Extension/.github/workflows/CICD.yaml index ffd1690ddb..3b02a1f4bc 100644 --- a/Templates/Per Tenant Extension/.github/workflows/CICD.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/CICD.yaml @@ -352,6 +352,7 @@ jobs: - name: Deploy to Business Central id: Deploy + if: hashFiles('.artifacts/**/*.app') != '' uses: microsoft/AL-Go-Actions/Deploy@main env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' @@ -405,6 +406,7 @@ jobs: getSecrets: '${{ matrix.deliveryTarget }}Context' - name: Deliver + if: hashFiles('.artifacts/**/*.app') != '' uses: microsoft/AL-Go-Actions/Deliver@main env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' From 60a16faa444933a9b87d9b5b6cea88930a6160ee Mon Sep 17 00:00:00 2001 From: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com> Date: Wed, 18 Feb 2026 16:24:55 +0100 Subject: [PATCH 06/10] Update release notes and documentation to clarify automatic skip behavior for delivery and deployment jobs when no app artifacts are available --- RELEASENOTES.md | 2 +- Scenarios/DeliveryTargets.md | 2 ++ Workshop/ContinuousDelivery.md | 6 ++++++ Workshop/ContinuousDeployment.md | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 39e85affc2..36a2b5f64f 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,7 +1,7 @@ ### Issues - Issue 1915 CICD fails on releases/26.x branch - '26.x' cannot be recognized as a semantic version string -- Deliver and Deploy actions now skip execution when no app artifacts are found, preventing errors on initial commits +- Issue 2126 Deliver and Deploy actions now skip execution when no app artifacts are found, preventing errors on initial commits ### The default pull request trigger is changing diff --git a/Scenarios/DeliveryTargets.md b/Scenarios/DeliveryTargets.md index 87fe57bbf0..67cce77692 100644 --- a/Scenarios/DeliveryTargets.md +++ b/Scenarios/DeliveryTargets.md @@ -294,6 +294,8 @@ Your custom delivery script receives a hash table with the following parameters: > **Note:** The folder parameters (`*Folder`) may be `$null` if no artifacts of that type were found. The plural versions (`*Folders`) contain arrays of all matching folders across different build modes. +> **Important:** The delivery step is automatically skipped at the workflow level when no app artifacts are available. This means your custom delivery script will not be executed if no app artifacts were built. This behavior prevents errors on initial commits, failed builds, or branches without code changes that produce artifacts. + ### Branch-Specific Delivery Configure different delivery targets for different branches: diff --git a/Workshop/ContinuousDelivery.md b/Workshop/ContinuousDelivery.md index d322be911f..e6e1276367 100644 --- a/Workshop/ContinuousDelivery.md +++ b/Workshop/ContinuousDelivery.md @@ -98,6 +98,12 @@ For detailed step-by-step instructions, configuration examples, and troubleshoot Custom delivery will be handled in an advanced part of this workshop later. +## Important Note: Automatic Skip Behavior + +Delivery jobs automatically skip execution when no app artifacts are available. + +This skip behavior prevents delivery errors and ensures that delivery targets are only invoked when there are actual artifacts to deliver. You'll see the delivery step appear as skipped in the workflow summary when this occurs. + OK, so **CD** stands for **Continuous Delivery**, I thought it was **Continuous Deployment**? Well, it is actually both, so let's talk about **Continuous Deployment**... ______________________________________________________________________ diff --git a/Workshop/ContinuousDeployment.md b/Workshop/ContinuousDeployment.md index 5c4e60d256..3fd4475577 100644 --- a/Workshop/ContinuousDeployment.md +++ b/Workshop/ContinuousDeployment.md @@ -86,6 +86,12 @@ Paste the value from the clipboard into the "Value" field of the **AuthContext** AL-Go can also be setup for custom deployment when you want to deploy to non-SaaS environments. More about this in the advanced section. +## Important Note: Automatic Skip Behavior + +Deployment jobs automatically skip execution when no app artifacts are available. + +This skip behavior prevents deployment errors and ensures that environments are only targeted when there are actual artifacts to deploy. You'll see the deployment step appear as skipped in the workflow summary when this occurs. + This section was about Continuous Deployment, but you might not want to deploy to production environments continuously - how can we publish to production on demand? ______________________________________________________________________ From 23495bca0acea0618baa715d49accf3627933b6d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:04:50 +0000 Subject: [PATCH 07/10] Move release notes entry to next release section Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- RELEASENOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3a425d9853..ac1c759596 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -2,6 +2,7 @@ - Attempt to start docker service in case it is not running - NextMajor (v28) fails when downloading dependencies from NuGet-feed +- Issue 2126 Deliver and Deploy actions now skip execution when no app artifacts are found, preventing errors on initial commits ## v8.3 @@ -9,7 +10,6 @@ - Issue 2107 Publish a specific build mode to an environment - Issue 1915 CICD fails on releases/26.x branch - '26.x' cannot be recognized as a semantic version string -- Issue 2126 Deliver and Deploy actions now skip execution when no app artifacts are found, preventing errors on initial commits ### The default pull request trigger is changing From 554251644702f364e45eed2f9ad699fba087289a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:08:12 +0000 Subject: [PATCH 08/10] Add notices when Deploy and Deliver steps are skipped due to no app artifacts Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- Templates/AppSource App/.github/workflows/CICD.yaml | 10 ++++++++++ .../Per Tenant Extension/.github/workflows/CICD.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/Templates/AppSource App/.github/workflows/CICD.yaml b/Templates/AppSource App/.github/workflows/CICD.yaml index d9766f5be6..a18d87a163 100644 --- a/Templates/AppSource App/.github/workflows/CICD.yaml +++ b/Templates/AppSource App/.github/workflows/CICD.yaml @@ -349,6 +349,11 @@ jobs: type: 'CD' deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }} + - name: Deployment skipped + if: hashFiles('.artifacts/**/*.app') == '' + run: | + Write-Host "::Notice::Deployment to environment ${{ matrix.environment }} was skipped because no app artifacts were found" + - name: Deploy to Power Platform if: env.type == 'PTE' && env.powerPlatformSolutionFolder != '' uses: microsoft/AL-Go-Actions/DeployPowerPlatform@main @@ -403,6 +408,11 @@ jobs: deliveryTarget: ${{ matrix.deliveryTarget }} artifacts: '.artifacts' + - name: Delivery skipped + if: hashFiles('.artifacts/**/*.app') == '' + run: | + Write-Host "::Notice::Delivery to ${{ matrix.deliveryTarget }} was skipped because no app artifacts were found" + PostProcess: needs: [ Initialization, Build, Deploy, Deliver, DeployALDoc, CodeAnalysisUpload ] if: (!cancelled()) diff --git a/Templates/Per Tenant Extension/.github/workflows/CICD.yaml b/Templates/Per Tenant Extension/.github/workflows/CICD.yaml index a9cb207a74..aeee307245 100644 --- a/Templates/Per Tenant Extension/.github/workflows/CICD.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/CICD.yaml @@ -363,6 +363,11 @@ jobs: type: 'CD' deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }} + - name: Deployment skipped + if: hashFiles('.artifacts/**/*.app') == '' + run: | + Write-Host "::Notice::Deployment to environment ${{ matrix.environment }} was skipped because no app artifacts were found" + - name: Deploy to Power Platform if: env.type == 'PTE' && env.powerPlatformSolutionFolder != '' uses: microsoft/AL-Go-Actions/DeployPowerPlatform@main @@ -417,6 +422,11 @@ jobs: deliveryTarget: ${{ matrix.deliveryTarget }} artifacts: '.artifacts' + - name: Delivery skipped + if: hashFiles('.artifacts/**/*.app') == '' + run: | + Write-Host "::Notice::Delivery to ${{ matrix.deliveryTarget }} was skipped because no app artifacts were found" + PostProcess: needs: [ Initialization, Build, BuildPP, Deploy, Deliver, DeployALDoc, CodeAnalysisUpload ] if: (!cancelled()) From cb11b6e8dabaf2b709206cd85982149bcf5fefca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 07:15:06 +0000 Subject: [PATCH 09/10] Update DeliveryTargets.md to remove inaccurate statements about skip behavior Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- Scenarios/DeliveryTargets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scenarios/DeliveryTargets.md b/Scenarios/DeliveryTargets.md index 67cce77692..0270f541ba 100644 --- a/Scenarios/DeliveryTargets.md +++ b/Scenarios/DeliveryTargets.md @@ -294,7 +294,7 @@ Your custom delivery script receives a hash table with the following parameters: > **Note:** The folder parameters (`*Folder`) may be `$null` if no artifacts of that type were found. The plural versions (`*Folders`) contain arrays of all matching folders across different build modes. -> **Important:** The delivery step is automatically skipped at the workflow level when no app artifacts are available. This means your custom delivery script will not be executed if no app artifacts were built. This behavior prevents errors on initial commits, failed builds, or branches without code changes that produce artifacts. +> **Important:** The delivery step is automatically skipped at the workflow level when no app artifacts are available. This means your custom delivery script will not be executed if no app artifacts were built. This behavior prevents errors on initial commits when no apps have been built yet. ### Branch-Specific Delivery From 4fa1f34e38a352128334bd5a068239cbee16996f Mon Sep 17 00:00:00 2001 From: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com> Date: Wed, 4 Mar 2026 11:26:31 +0100 Subject: [PATCH 10/10] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Workshop/ContinuousDelivery.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Workshop/ContinuousDelivery.md b/Workshop/ContinuousDelivery.md index e6e1276367..8a337cbacd 100644 --- a/Workshop/ContinuousDelivery.md +++ b/Workshop/ContinuousDelivery.md @@ -100,9 +100,9 @@ Custom delivery will be handled in an advanced part of this workshop later. ## Important Note: Automatic Skip Behavior -Delivery jobs automatically skip execution when no app artifacts are available. +The Deliver step/action is skipped when no app artifacts are available. -This skip behavior prevents delivery errors and ensures that delivery targets are only invoked when there are actual artifacts to deliver. You'll see the delivery step appear as skipped in the workflow summary when this occurs. +This skip behavior prevents delivery errors and ensures that delivery targets are only invoked when there are actual artifacts to deliver. You'll see the Deliver step/action appear as skipped in the workflow summary when this occurs. OK, so **CD** stands for **Continuous Delivery**, I thought it was **Continuous Deployment**? Well, it is actually both, so let's talk about **Continuous Deployment**...