forked from Azure/AzOps-Accelerator
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (88 loc) · 2.35 KB
/
Copy pathvalidate.yml
File metadata and controls
109 lines (88 loc) · 2.35 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
name: "AzOps - Validate"
on:
#
# Pull Request
# Upon the creation of a new Pull Request in the root folder
# this workflow will execute.
#
pull_request:
paths:
- "root/**"
#
# Permissions required for the pipeline to interact with repo and federated credentials
#
permissions:
id-token: write
contents: write
pull-requests: write
env:
#
# Credentials
#
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_ENVIRONMENT: ${{ secrets.ARM_ENVIRONMENT }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
AZOPS_MODULE_VERSION: ${{ secrets.AZOPS_MODULE_VERSION }}
APPLICATIONINSIGHTS_CONNECTIONSTRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTIONSTRING }}
#
# modulesFolder
# To enable caching of PowerShell modules between
# runs, the modules are stored in a modules folder
# that can be cached.
#
modulesFolder: "~/.local/share/powershell/Modules"
jobs:
validate:
#
# Validate
#
name: "Validate"
runs-on: ubuntu-20.04
#
# Environment if using Federated Credentials
# https://github.com/azure/azops/wiki/oidc
#
# environment: prod
steps:
#
# Checkout
# Checks-out the repository
#
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
#
# Shared steps
# Include shared steps from the 'shared.yml' file
# to not have to repeat them in every pipeline.
#
- name: 'Shared steps'
uses: ./.github/actions/sharedSteps
#
# Validate
# Run what-if deployment on any templates changed
# in the last commit
#
- name: 'Validate'
with:
deploy: false
name: 'Validate'
uses: ./.github/actions/validate-deploy
#
# Results
#
- name: "Results"
if: always()
shell: bash
run: |
if [ -f /tmp/OUTPUT.md ]; then
gh pr comment ${{ github.event.pull_request.number }} --body-file /tmp/OUTPUT.md
else
echo "There are no results, so no comments are posted. For further information please look into the validate step."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}