Skip to content

[Bug]: CheckForUpdates fails with 404 when fetching latest SHA from microsoft/AL-Go-PTE template #2185

@ChrisChristophers

Description

@ChrisChristophers

AL-Go version

8.1

Describe the issue

When running the "Update AL-Go System Files" workflow (CheckForUpdates action), the workflow
fails with a 404 error when attempting to retrieve the latest commit SHA from the template repository
https://github.com/microsoft/AL-Go-PTE@main.

The full error message is:

Unexpected error when running action. Error Message: Failed to update AL-Go System Files.
Could not get the latest SHA from template (https://github.com/microsoft/AL-Go-PTE@main).
(Error was The remote server returned an error: (404) Not Found. Not Found)

Stack trace points to:

  • GetLatestTemplateSha in CheckForUpdates.HelperFunctions.ps1: line 83
  • DownloadTemplateRepository in CheckForUpdates.HelperFunctions.ps1: line 56
  • CheckForUpdates.ps1: line 64

Environment details:

  • AL-Go Actions version: v8.1 (SHA: 5628b94ecf2f1f06fd6eed86e25027a60ae93ab6)
  • BcContainerHelper version: 6.1.11
  • Runner: Windows Server 2025 (windows-latest hosted runner)
  • Template URL configured: https://github.com/microsoft/AL-Go-PTE@main
  • Template SHA stored in settings: 2b0291277622df06df2856bc05768be2ebb5a6b5
  • Repo type: PTE
  • The workflow was triggered via workflow_dispatch with directCommit=false and downloadLatest=true

Note: The repository calling this workflow is hosted on GitHub Enterprise Server (GHES), which
may be relevant if the GetLatestTemplateSha function uses API calls that require specific
authentication for accessing public github.com repositories from a GHES instance.

Expected behavior

The "Update AL-Go System Files" workflow should successfully retrieve the latest commit SHA from the
microsoft/AL-Go-PTE template repository on github.com, compare it with the stored templateSha,
and either update the AL-Go system files or report that no update is needed — completing the workflow
without errors.

Steps to reproduce

  1. Set up an AL-Go for GitHub repository (PTE type) on a GitHub Enterprise Server instance using
    AL-Go v8.1.
  2. Configure templateUrl as https://github.com/microsoft/AL-Go-PTE@main in
    .github/AL-Go-Settings.json or .AL-Go/settings.json.
  3. Create a ghTokenWorkflow secret (GitHub App or PAT).
  4. Trigger the "Update AL-Go System Files" workflow via workflow_dispatch with:
    • directCommit: false
    • downloadLatest: true
  5. Observe the workflow fails at the "Update AL-Go system files" step with a 404 error from
    GetLatestTemplateSha.

Additional context (logs, screenshots, etc.)

Relevant log excerpt from the CheckForUpdates step:

TemplateUrl: https://github.com/microsoft/AL-Go-PTE@main
TemplateSha: 2b0291277622df06df2856bc05768be2ebb5a6b5
DownloadLatest: True
Get latest SHA for https://github.com/microsoft/AL-Go-PTE@main
The remote server returned an error: (404) Not Found.

Not Found

##[error]Unexpected error when running action. Error Message: Failed to update AL-Go System Files. 
Could not get the latest SHA from template (https://github.com/microsoft/AL-Go-PTE@main). 
(Error was The remote server returned an error: (404) Not Found.   Not Found ), 
StackTrace: at GetLatestTemplateSha, 
D:\a\_actions\microsoft\AL-Go-Actions\v8.1\CheckForUpdates\CheckForUpdates.HelperFunctions.ps1: line 83 
<- at DownloadTemplateRepository, 
D:\a\_actions\microsoft\AL-Go-Actions\v8.1\CheckForUpdates\CheckForUpdates.HelperFunctions.ps1: line 56 
<- at <ScriptBlock>, 
D:\a\_actions\microsoft\AL-Go-Actions\v8.1\CheckForUpdates\CheckForUpdates.ps1: line 64

Note: Prior to reaching the template, the workflow successfully accessed the template repository
to verify it exists (HTTP 200 with empty content). The 404 occurs specifically when calling
GetLatestTemplateSha, suggesting the API endpoint used to resolve the branch/SHA may differ from
the initial check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions