forked from Azure/ResourceModules
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.81 KB
/
platform.updateStaticTestDocs.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
name: ".Platform: Update Static Test Documentation"
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/workflows/platform.updateStaticTestDocs.yml'
- 'utilities/pipelines/staticValidation/module.tests.ps1'
- utilities/tools/platform/Set-StaticTestDocumentation.ps1
env:
pipelinePrincipalGitUserName: "CARMLPipelinePrincipal"
pipelinePrincipalGitUserEmail: "[email protected]"
jobs:
job_update_static_test_docs:
name: "Update file"
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.PLATFORM_REPO_UPDATE_PAT }}" # Sets general GIT credentials up
- name: "Update file"
shell: pwsh
run: |
# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'tools' 'platform' 'Set-StaticTestDocumentation.ps1')
$functionInput = @{
TestFilePath = Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'staticValidation' 'module.tests.ps1'
WikiFilePath = Join-Path $env:GITHUB_WORKSPACE 'docs' 'wiki' 'The CI environment - Static validation.md'
}
Write-Verbose "Invoke task with" -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
Set-StaticTestDocumentation @functionInput -Verbose
- name: "Push changes"
shell: pwsh
run: |
git config --global user.email '${{ env.pipelinePrincipalGitUserEmail }}'
git config --global user.name '${{ env.pipelinePrincipalGitUserName }}'
git pull
git status
git add .
git commit -m 'Push updated API Specs file'
git push