Update AL-Go System Files #336
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ' Update AL-Go System Files' | |
on: | |
workflow_dispatch: | |
inputs: | |
templateUrl: | |
description: Template Repository URL (current is https://github.com/microsoft/AL-Go-PTE@preview) | |
required: false | |
default: '' | |
downloadLatest: | |
description: Download latest from template repository | |
type: boolean | |
default: true | |
directCommit: | |
description: Direct Commit? | |
type: boolean | |
default: false | |
permissions: | |
actions: read | |
contents: read | |
id-token: write | |
defaults: | |
run: | |
shell: powershell | |
env: | |
ALGoOrgSettings: ${{ vars.ALGoOrgSettings }} | |
ALGoRepoSettings: ${{ vars.ALGoRepoSettings }} | |
jobs: | |
UpdateALGoSystemFiles: | |
name: 'Update AL-Go System Files' | |
environment: Official-Build | |
needs: [ ] | |
runs-on: [ windows-latest ] | |
steps: | |
- name: Dump Workflow Information | |
uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@a46044fa1ffca4b1ff05d2d1844fd7d5922c6984 | |
with: | |
shell: powershell | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Initialize the workflow | |
id: init | |
uses: microsoft/AL-Go/Actions/WorkflowInitialize@a46044fa1ffca4b1ff05d2d1844fd7d5922c6984 | |
with: | |
shell: powershell | |
- name: Read settings | |
uses: microsoft/AL-Go/Actions/ReadSettings@a46044fa1ffca4b1ff05d2d1844fd7d5922c6984 | |
with: | |
shell: powershell | |
get: templateUrl | |
- name: Read secrets | |
id: ReadSecrets | |
uses: microsoft/AL-Go/Actions/ReadSecrets@a46044fa1ffca4b1ff05d2d1844fd7d5922c6984 | |
with: | |
shell: powershell | |
gitHubSecrets: ${{ toJson(secrets) }} | |
getSecrets: 'ghTokenWorkflow' | |
- name: Override templateUrl | |
env: | |
templateUrl: ${{ github.event.inputs.templateUrl }} | |
run: | | |
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 | |
$templateUrl = $ENV:templateUrl | |
if ($templateUrl) { | |
Write-Host "Using Template Url: $templateUrl" | |
Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "templateUrl=$templateUrl" | |
} | |
- name: Calculate Input | |
env: | |
directCommit: '${{ github.event.inputs.directCommit }}' | |
downloadLatest: ${{ github.event.inputs.downloadLatest }} | |
eventName: ${{ github.event_name }} | |
run: | | |
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 | |
$directCommit = $ENV:directCommit | |
$downloadLatest = $ENV:downloadLatest | |
Write-Host $ENV:eventName | |
if ($ENV:eventName -eq 'schedule') { | |
Write-Host "Running Update AL-Go System Files on a schedule. Setting DirectCommit and DownloadLatest to true" | |
$directCommit = 'true' | |
$downloadLatest = 'true' | |
} | |
Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "directCommit=$directCommit" | |
Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "downloadLatest=$downloadLatest" | |
- name: Update AL-Go system files | |
uses: microsoft/AL-Go/Actions/CheckForUpdates@a46044fa1ffca4b1ff05d2d1844fd7d5922c6984 | |
with: | |
shell: powershell | |
token: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).ghTokenWorkflow }} | |
downloadLatest: ${{ env.downloadLatest }} | |
update: 'Y' | |
templateUrl: ${{ env.templateUrl }} | |
directCommit: ${{ env.directCommit }} | |
- name: Finalize the workflow | |
if: always() | |
uses: microsoft/AL-Go/Actions/WorkflowPostProcess@a46044fa1ffca4b1ff05d2d1844fd7d5922c6984 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
shell: powershell | |
telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} | |
currentJobContext: ${{ toJson(job) }} |