-
Notifications
You must be signed in to change notification settings - Fork 31
75 lines (64 loc) · 2.09 KB
/
ci.yaml
File metadata and controls
75 lines (64 loc) · 2.09 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
#
# Run CI tests
#
# Note:
# This workflow is designed to run only in Azure/PSRule.Rules.Azure-quickstart.
# You can safely deleted this file if you have templated this repository to your GitHub organization.
# For PSRule documentation see:
# https://aka.ms/ps-rule
# For action details see:
# https://aka.ms/ps-rule-action
name: CI
# Run for main or PRs against main
on:
push:
branches: [main, 'dependencies/*']
pull_request:
branches:
- main
schedule:
- cron: '54 20 * * 0' # At 08:54 PM, on Sunday each week
workflow_dispatch:
permissions: {}
jobs:
test:
name: Test
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
if: github.repository == 'Azure/PSRule.Rules.Azure-quickstart'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check repository content
uses: microsoft/ps-rule@46451b8f5258c41beb5ae69ed7190ccbba84112c # v2.9.0
with:
modules: PSRule.Rules.MSFT.OSS
# Install a specific version of Bicep for consistency across CI runs.
# - name: Install Bicep
# run: az bicep install --version v0.39.26
- name: Check Azure samples
uses: microsoft/ps-rule@46451b8f5258c41beb5ae69ed7190ccbba84112c # v2.9.0
with:
modules: PSRule.Rules.Azure
outputFormat: Sarif
outputPath: reports/ps-rule-results.sarif
summary: true
# env:
# # Use Bicep from Azure CLI.
# PSRULE_AZURE_BICEP_USE_AZURE_CLI: true
- name: Upload results to security tab
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.5
if: always()
with:
sarif_file: reports/ps-rule-results.sarif
- name: Upload results
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: PSRule-Sarif
path: reports/ps-rule-results.sarif
retention-days: 1
if-no-files-found: error