Skip to content

Update AL-Go System Files #90

Update AL-Go System Files

Update AL-Go System Files #90

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: ''
directCommit:
description: Direct COMMIT (Y/N)
required: false
default: 'N'
permissions:
contents: read
defaults:
run:
shell: powershell
env:
ALGoOrgSettings: ${{ vars.ALGoOrgSettings }}
ALGoRepoSettings: ${{ vars.ALGoRepoSettings }}
jobs:
UpdateALGoSystemFiles:
runs-on: [ windows-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Initialize the workflow
id: init
uses: microsoft/AL-Go/Actions/WorkflowInitialize@ce6a36367580e96a44bbc3b5dd31238d945cf8fe
with:
shell: powershell
eventId: "DO0098"
- name: Read settings
uses: microsoft/AL-Go/Actions/ReadSettings@ce6a36367580e96a44bbc3b5dd31238d945cf8fe
with:
shell: powershell
get: templateUrl
- name: Read secrets
id: ReadSecrets
uses: microsoft/AL-Go/Actions/ReadSecrets@ce6a36367580e96a44bbc3b5dd31238d945cf8fe
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 DirectCommit
env:
directCommit: ${{ github.event.inputs.directCommit }}
eventName: ${{ github.event_name }}
run: |
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
$directCommit = $ENV:directCommit
Write-Host $ENV:eventName
if ($ENV:eventName -eq 'schedule') {
Write-Host "Running Update AL-Go System Files on a schedule. Setting DirectCommit = Y"
$directCommit = 'Y'
}
Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "DirectCommit=$directCommit"
- name: Update AL-Go system files
uses: microsoft/AL-Go/Actions/CheckForUpdates@ce6a36367580e96a44bbc3b5dd31238d945cf8fe
with:
shell: powershell
parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}
token: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).ghTokenWorkflow }}
Update: Y
templateUrl: ${{ env.templateUrl }}
directCommit: ${{ env.directCommit }}
- name: Finalize the workflow
if: always()
uses: microsoft/AL-Go/Actions/WorkflowPostProcess@ce6a36367580e96a44bbc3b5dd31238d945cf8fe
with:
shell: powershell
eventId: "DO0098"
telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}