-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.3 KB
/
update-aliases.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Update Aliases
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches:
- main
permissions:
id-token: write
contents: write
# pull-requests: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login
uses: ./.github/actions/az-login
with:
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
- name: Get Updated Aliases
shell: pwsh
run: |
Set-Location $ENV:GITHUB_WORKSPACE
Write-Host "workspace: $ENV:GITHUB_WORKSPACE"
dir
./src/Get-ResourceAliases.ps1
- name: Auto commit changes
run: |
cd $GITHUB_WORKSPACE
now=$(date +'%a %d %b %Y')
git config --global user.email $ENV:GIT_USER_EMAIL
git config --global user.name $ENV:GIT_USER_NAME
git add --all
if [ -n "$(git status --porcelain)" ]
then
git commit -a -m "auto update aliases $now"
git push
fi
# - name: Create pull request
# uses: peter-evans/create-pull-request@v5
# with:
# branch: aliases
# title: "Auto update aliases"
# labels: |
# Automated PR