Skip to content

Commit 4452460

Browse files
anwatherAnthony Watherston
andauthored
Add daily check for new ALZ releases (#1047)
* Add new workflow * Add temp trigger * Test issue creation * Add id to step * Testing * Add token * Add checkout * Added schedule --------- Co-authored-by: Anthony Watherston <Anthony.Watherston@microsoft.com>
1 parent 7380a03 commit 4452460

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check ALZ Release
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * *' # Every day at 8 AM
6+
permissions:
7+
issues: write
8+
9+
jobs:
10+
check-and-create-issue:
11+
runs-on: windows-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Run Script
16+
id: run-script
17+
shell: pwsh
18+
run: |
19+
$response = ((iwr "https://api.github.com/repos/Azure/Azure-Landing-Zones-Library/releases/latest").Content | ConvertFrom-Json | Select-Object -ExpandProperty published_at) -gt (Get-Date).AddDays(-1)
20+
Write-Output $response
21+
echo "response=$response" >> $env:GITHUB_OUTPUT
22+
- name: Create Issue
23+
if: ${{ steps.run-script.outputs.response == 'True' }}
24+
run: |
25+
gh issue create --title "New ALZ Release Published" --body "A new release has been published in the Azure Landing Zones Library. Please review and update the Enterprise-Scale Policy as Code library accordingly."
26+
env:
27+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)