diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 079226dbe0..36a2b5f64f 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 +- 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/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 }}' 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? ______________________________________________________________________