forked from azure-ad-b2c/deploy-trustframework-policy
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 2.22 KB
/
pr-checks.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
62
63
64
65
66
67
68
name: PR Checks
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
application-ci:
name: Install and run PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install PSScriptAnalyzer module
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PSScriptAnalyzer -ErrorAction Stop
- name: Lint with PSScriptAnalyzer
shell: pwsh
run: |
Invoke-ScriptAnalyzer -Path *.ps1 -Recurse -Outvariable issues
$errors = $issues.Where({$_.Severity -eq 'Error'})
$warnings = $issues.Where({$_.Severity -eq 'Warning'})
if ($errors) {
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop
} else {
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
}
pr-labels:
if: ${{ github.actor != 'dependabot[bot]' }}
name: PR Labels
uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/pr-labels.yaml@2
secrets:
PAT_ACTION_CI: ${{ secrets.PAT_ACTION_CI }}
codeowners-validation:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Codeowners File Validation
uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/codeowners-validation.yaml@2
jira-lint:
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'amutechtest' && github.ref != 'refs/heads/development' && github.ref != 'refs/heads/main' }}
name: Jira PR Linter
uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/jira-lint.yaml@2
with:
fail-on-error: false
skip-comments: true
secrets:
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
lint:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Simple Lint
uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/simple-lint.yaml@2
secrets:
PAT_ACTION_CI: ${{ secrets.PAT_ACTION_CI }}
required-checks:
name: Required Checks
runs-on: ubuntu-latest
needs: [application-ci]
steps:
- name: Checkout code
uses: actions/checkout@v3