diff --git a/Actions/ReadSettings/ReadSettings.ps1 b/Actions/ReadSettings/ReadSettings.ps1 index c19bf94e8a..ddd7ead5d5 100644 --- a/Actions/ReadSettings/ReadSettings.ps1 +++ b/Actions/ReadSettings/ReadSettings.ps1 @@ -19,7 +19,7 @@ else { $getSettings = @() } -if ($ENV:GITHUB_EVENT_NAME -in @("pull_request_target", "pull_request")) { +if ($ENV:GITHUB_EVENT_NAME -in @("pull_request_target", "pull_request", "merge_group")) { # In case of a PR, we do not want to sign apps and we want to use versioning strategy 15 (maxValue + runNumber) OutputDebug "Applying settings for pull request: doNotSignApps = true, versioningStrategy = 15" $settings.doNotSignApps = $true diff --git a/RELEASENOTES.md b/RELEASENOTES.md index bda0dd4a16..6618aefc1b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -18,6 +18,13 @@ This ensures consistent default values across both manual workflow runs and reus Read more at [workflowDefaultInputs](https://aka.ms/algosettings#workflowDefaultInputs). +### Merge queue support + +AL-Go now supports GitHub's merge queue feature out of the box! The `merge_group` trigger has been added to the Pull Request Build workflow, enabling seamless integration with merge queues. When you have the merge queue feature enabled in your repo, multiple PRs will automatically be validated together. Read more about merge queues [here](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue). + +> [!WARNING] +> If you rely on a custom workflow for merge queue validation, you may need to adjust your setup to avoid duplicate builds. + ### AL-Go Telemetry updates AL-Go telemetry now includes test results so you can more easily see how many AL tests, Page Scripting tests and BCPT tests ran in your workflows across all your repositories. Documentation for this can be found on [this article](https://github.com/microsoft/AL-Go/blob/main/Scenarios/EnablingTelemetry.md) on enabling telemetry. diff --git a/Templates/AppSource App/.github/workflows/PullRequestHandler.yaml b/Templates/AppSource App/.github/workflows/PullRequestHandler.yaml index 574a5422e8..314f3290c7 100644 --- a/Templates/AppSource App/.github/workflows/PullRequestHandler.yaml +++ b/Templates/AppSource App/.github/workflows/PullRequestHandler.yaml @@ -3,9 +3,10 @@ name: 'Pull Request Build' on: pull_request_target: branches: [ 'main' ] + merge_group: concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event_name == 'merge_group' && github.run_id || github.event.pull_request.number }} cancel-in-progress: true defaults: @@ -56,7 +57,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: lfs: true - ref: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} + ref: ${{ github.event_name == 'pull_request' && github.sha || github.event_name == 'merge_group' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} - name: Initialize the workflow id: init @@ -103,7 +104,7 @@ jobs: with: shell: ${{ matrix.githubRunnerShell }} runsOn: ${{ matrix.githubRunner }} - checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} + checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || github.event_name == 'merge_group' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} @@ -118,7 +119,7 @@ jobs: CodeAnalysisUpload: needs: [ Initialization, Build ] - if: (!cancelled()) && (needs.Initialization.outputs.trackALAlertsInGitHub == 'True') + if: (!cancelled()) && (needs.Initialization.outputs.trackALAlertsInGitHub == 'True') && (github.event_name != 'merge_group') runs-on: [ windows-latest ] name: Code Analysis Processing steps: diff --git a/Templates/Per Tenant Extension/.github/workflows/PullRequestHandler.yaml b/Templates/Per Tenant Extension/.github/workflows/PullRequestHandler.yaml index 574a5422e8..314f3290c7 100644 --- a/Templates/Per Tenant Extension/.github/workflows/PullRequestHandler.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/PullRequestHandler.yaml @@ -3,9 +3,10 @@ name: 'Pull Request Build' on: pull_request_target: branches: [ 'main' ] + merge_group: concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event_name == 'merge_group' && github.run_id || github.event.pull_request.number }} cancel-in-progress: true defaults: @@ -56,7 +57,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: lfs: true - ref: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} + ref: ${{ github.event_name == 'pull_request' && github.sha || github.event_name == 'merge_group' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} - name: Initialize the workflow id: init @@ -103,7 +104,7 @@ jobs: with: shell: ${{ matrix.githubRunnerShell }} runsOn: ${{ matrix.githubRunner }} - checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} + checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || github.event_name == 'merge_group' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} @@ -118,7 +119,7 @@ jobs: CodeAnalysisUpload: needs: [ Initialization, Build ] - if: (!cancelled()) && (needs.Initialization.outputs.trackALAlertsInGitHub == 'True') + if: (!cancelled()) && (needs.Initialization.outputs.trackALAlertsInGitHub == 'True') && (github.event_name != 'merge_group') runs-on: [ windows-latest ] name: Code Analysis Processing steps: