---
id: change/al-go/2396
type: change
title: "#2396 Fix deployment environment discovery pagination"
summary: Deployment environment discovery now fetches all pages of environments from GitHub instead of only the first page, ensuring CI/CD includes all available deployment targets.
tier: official
language: en
tags:
  - fix
  - main
system: platform
review:
  state: reviewed
  by: opus
  at: "2026-10-17T01:12:12.701Z"
  flags: []
generated:
  at: "2026-10-17T00:20:42.327Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 5a8b80e995f10776840da580018fb2b7950cd00d
evidence:
  - kind: code
    url: https://github.com/microsoft/AL-Go/pull/2396
    title: "microsoft/AL-Go#2396: Fix deployment environment discovery pagination"
    date: "2026-10-09"
    commit: 5a8b80e995f10776840da580018fb2b7950cd00d
    t: null
    quote: GitHub returns 30 environments by default, but deployment discovery previously fetched only one page.
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 2396
repo: microsoft/AL-Go
source_id: al-go-prs
url: https://github.com/microsoft/AL-Go/pull/2396
kind: pr
base_branch: main
major: null
merged_at: "2026-10-09T13:34:49Z"
author: aholstrup1
author_type: User
community_contribution: false
labels: []
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 3
  additions: 118
  deletions: 14
  al: 1
apps: []
objects_touched: []
objects_unjoined:
  - path: Actions/DetermineDeploymentEnvironments/DetermineDeploymentEnvironments.ps1
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues:
  - 2387
work_items: []
systems:
  - platform
quote: GitHub returns 30 environments by default, but deployment discovery previously fetched only one page.
joined_against:
  major: null
  commit: null
---

# #2396 Fix deployment environment discovery pagination

> Deployment environment discovery now fetches all pages of environments from GitHub instead of only the first page, ensuring CI/CD includes all available deployment targets.

[Pull request](https://github.com/microsoft/AL-Go/pull/2396) · merged into `main` on 2026-10-09 by aholstrup1 · 3 files (+118 -14), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Fetches environments in pages of 100 until a page contains fewer results
- Retains full environment metadata for branch-policy filtering across all pages
- Handles edge case where environment count is exact multiple of 100
- Propagates failures on subsequent pages to prevent incomplete deployment selection
- Covers regression scenarios including empty results, page boundaries, and second-page branch policies
- Behaviour changes for users or extensions.

## AL objects touched

- `Actions/DetermineDeploymentEnvironments/DetermineDeploymentEnvironments.ps1`: modified, not in the BC? snapshot

## Context

- Fixes: [#2387 [Bug]: DetermineDeploymentEnvironments ignores GitHub environments after the first 30 (no pagination)](https://github.com/microsoft/AL-Go/issues/2387) (open)
- Systems: platform
- From the description: "GitHub returns 30 environments by default, but deployment discovery previously fetched only one page."

Source: metadata of a merged pull request in microsoft/AL-Go (al-go): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
