Update Aliases #1635
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 Aliases | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: [ master ] | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Azure Login | |
uses: Azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
enable-AzPSSession: true | |
- name: Get Updated Aliases | |
uses: Azure/powershell@v1 | |
with: | |
inlineScript: | | |
Set-Location $ENV:GITHUB_WORKSPACE | |
Write-Host "workspace: $ENV:GITHUB_WORKSPACE" | |
dir | |
./src/Get-ResourceAliases.ps1 | |
azPSVersion: latest | |
- name: Commit changes | |
run: | | |
cd $GITHUB_WORKSPACE | |
now=$(date) | |
git config --global user.email "[email protected]" | |
git config --global user.name "Maciej Porebski" | |
git add --all | |
if [ -n "$(git status --porcelain)" ] | |
then | |
git commit -a -m "auto update aliases $now" | |
git push | |
fi |