Check For Updates
The Check For Updates action monitors and applies updates to AL-Go system files in your repository. It ensures your AL-Go installation stays current with the latest features, bug fixes, and improvements from the template repository.Overview
This action helps maintain your AL-Go installation by:- Checking for updates from the AL-Go template repository
- Comparing your current version against the latest available
- Optionally downloading and applying updates automatically
- Creating pull requests or direct commits with updates
- Tracking update history to avoid redundant downloads
By default, this action only checks for updates without applying them. Set
update: 'Y' to actually apply updates to your repository.Inputs
The shell in which to run the PowerShell script:
powershell- Windows PowerShell 5.1pwsh- PowerShell 7+
The GitHub username of the actor running the action. This is used for attribution in commits and pull requests created by the update process.
Base64 encoded GhTokenWorkflow secret. This token is used for authenticating when creating pull requests or pushing commits. If not provided, the default
GITHUB_TOKEN is used.URL of the AL-Go template repository to check for updates. If not specified, the action uses the template repository that was originally used to create your repository. This is stored in your AL-Go settings.Example:
https://github.com/microsoft/AL-Go-PTE@mainControls whether to download the latest version of the template:
true: Always download the latest version from the template repositoryfalse: Reuse the SHA from the last update, only downloading if there are changes
true for scheduled update checks, false for incremental updates.Determines whether to actually apply updates:
N: Only check for updates (default)Y: Download and apply updates to the repository
Y, the action will create commits with the updated files.The branch to update with AL-Go system files. This parameter behavior depends on the
directCommit setting:- If
directCommitisfalse: Updates are committed to this branch via pull request - If
directCommitistrue: This parameter is ignored and the current branch is updated
main, develop, al-go-updatesControls how updates are applied:
false: Create a pull request with updates (default, safer)true: Commit updates directly to the branch the action is running on
Outputs
This action does not produce any outputs. It performs its work by either:- Creating commits directly to the branch, or
- Creating a pull request with proposed updates
Usage Examples
Check for Updates Only
Auto-Update via Pull Request
Direct Commit Updates
Using Custom Template
Update Workflow
The Check For Updates action follows this workflow:- Determine Template: Identifies the template repository (from parameter or settings)
- Check Current Version: Reads the last update SHA from repository settings
- Download Template: Downloads the template repository (latest or from last SHA)
- Compare Files: Compares AL-Go system files between template and your repository
- Apply Updates (if
update: 'Y'):- Updates AL-Go system files with template versions
- Creates commit with changes
- Either pushes directly or creates pull request
AL-Go System Files
The action updates AL-Go system files, which typically include:- Workflow files in
.github/workflows/ - Action files in
.github/actions/orActions/ - Core PowerShell scripts
- Template settings and configurations
Update Strategies
Scheduled Updates with Review
Recommended approach for production repositories:Manual Updates on Demand
For controlled update timing:Automated Direct Updates
For non-critical repositories or dedicated update branches:Best Practices
Use Pull Requests for Protected Branches
Provide Custom Token for PRs
The defaultGITHUB_TOKEN may not trigger subsequent workflows. Use a custom token:
Test Updates in Development First
Run updates on a development branch before applying to main:Troubleshooting
No Updates Applied
If updates aren’t being applied:- Verify
updateis set to'Y'(as a string, not boolean) - Check that there are actually updates available
- Ensure the token has write permissions
- Review action logs for error messages
Template Not Found
If the template repository cannot be accessed:- Verify the
templateUrlis correct and accessible - Check that you have read access to the template repository
- For private templates, ensure the token has appropriate permissions
Pull Request Not Created
If no PR is created when expected:- Ensure
directCommitisfalse - Verify the
updateBranchdoesn’t already have the updates - Check that the token has permission to create PRs
- Review if there are any actual changes to commit
Direct Commit Fails
If direct commits fail:- Check branch protection rules
- Verify the token has push permissions
- Ensure the branch exists and is accessible
- Check for conflicts with existing changes
Template Repository
AL-Go provides several template repositories:- AL-Go-PTE: For Per-Tenant Extensions
- AL-Go-AppSource: For AppSource applications
templateUrl parameter.
Related Documentation
- AL-Go Workflows - Understanding AL-Go workflow structure
- Settings - Configuring AL-Go settings
- GitHub Actions Documentation - General GitHub Actions information