Read Settings
The Read Settings action loads and processes configuration settings from AL-Go settings files. It consolidates repository-level and project-level settings into environment variables and outputs that can be used by subsequent workflow steps.Overview
This action is typically one of the first steps in any AL-Go workflow. It:- Reads settings from
.AL-Go/settings.jsonand project-specific settings files - Merges repository and project settings with appropriate precedence
- Exposes settings as environment variables for easy access
- Provides specific outputs like runner configuration
- Supports selective setting retrieval through the
getparameter
The Read Settings action creates a compressed JSON structure containing ALL settings in the
env.Settings variable, regardless of the get parameter. The get parameter only controls which individual environment variables are created.Inputs
The shell in which to run the PowerShell script. Options:
powershell- Windows PowerShell 5.1pwsh- PowerShell 7+
Project folder path for multi-project repositories. When set to
. (default), only repository-level settings are loaded. Specify a project path to load both repository and project-specific settings.Build mode identifier. This parameter is typically only set when called from the internal
_BuildALGoProject workflow. The build mode can affect which settings are loaded and how they’re processed.The name of the workflow for which settings are being read. This allows for workflow-specific settings overrides.
Comma-separated list of specific settings to retrieve as individual environment variables. If empty, no individual environment variables are created (but
env.Settings still contains all settings).Example: "type,runs-on,shell,artifact"Outputs
The action provides both environment variables and output variables:Output Variables
GitHub runner configuration in compressed JSON format. This output contains the runner specifications that should be used for workflow jobs.
The shell that should be used for GitHub runner jobs. This is extracted from the settings and provided as a convenient output.
Environment Variables
A compressed JSON structure containing ALL AL-Go settings. This includes both repository-level and project-level settings (if a project was specified). This variable is available regardless of the
get parameter value.The settings structure includes configuration for:- Build artifacts and versions
- Runner specifications
- Project type and structure
- Build modes and options
- And all other AL-Go configuration
get parameter, an individual environment variable is created. For example, if get is "type,runs-on", then env.type and env.runs-on will be available.
Usage Example
Basic Usage
Reading Specific Settings
Multi-Project Repository
Using Runner Outputs
Settings Files
The Read Settings action processes settings from multiple sources with the following precedence (highest to lowest):- Project settings:
.AL-Go/<ProjectName>/.settings.json(if project specified) - Repository settings:
.AL-Go/settings.json - Default settings: Built-in defaults from AL-Go
Common Settings
Here are some commonly used settings:type- Repository type (PTE, AppSource App, etc.)artifact- Business Central artifact URL or versionruns-on- GitHub runner specificationshell- Default shell for PowerShell scriptsappFolders- Array of application folderstestFolders- Array of test app foldersversioningStrategy- Version numbering strategykeyVaultName- Azure Key Vault name (if using)
Advanced Usage
Accessing Settings in PowerShell
Conditional Settings
Troubleshooting
Settings Not Found
If settings are not being loaded:- Verify
.AL-Go/settings.jsonexists in your repository - Check JSON syntax for errors
- Ensure file permissions allow reading
Missing Project Settings
For project-specific settings:- Verify the project path is correct
- Ensure
.AL-Go/<ProjectName>/.settings.jsonexists - Check that the project folder structure matches AL-Go expectations
Environment Variables Not Set
If individual setting variables aren’t available:- Verify you’ve specified the setting name in the
getparameter - Check for typos in setting names
- Remember that
env.Settingsalways contains all settings as JSON
Related Actions
- Run Pipeline - Uses settings from this action
- Read Secrets - Also requires settings to be loaded