-
Notifications
You must be signed in to change notification settings - Fork 16
61 lines (52 loc) · 1.75 KB
/
update-microsoft-info.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
53
54
55
56
57
58
59
60
61
# Run daily and when custom data is updated to generate a new csv/json
name: update-microsoft-info
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
paths-ignore:
- 'README.md'
- '_info/**'
pull_request:
branches: [ "main" ]
# Run twice a day (5.30am and 5.30pm)
schedule:
- cron: '30 5,17 * * *'
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
id-token: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Azure AD Workload Identity Federation
uses: nicolonsky/WIF@v0.0.1
with:
tenant_id: '0817c655-a853-4d8f-9723-3a333b5b9235'
client_id: '38535360-9f3e-4b1e-a41e-b4af46afcb0c'
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Generate docs
run: |
Install-Module -Name Microsoft.Graph.Authentication
Install-Module -Name Microsoft.Graph.Applications
$token = $env:ACCESS_TOKEN | ConvertTo-SecureString -AsPlainText
Connect-MgGraph -AccessToken $token
./src/Export-MicrosoftApps.ps1
./src/Export-GraphPermissions.ps1
shell: pwsh
- name: Update repo
run: |
if [[ `git status --porcelain` ]]; then
# Changes
echo "Updating repo"
git config --global user.name 'Merill Fernando'
git config --global user.email 'merill@users.noreply.github.com'
git commit -am "Daily automation"
git push
else
# No changes
echo "No changes"
fi