-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (119 loc) · 3.66 KB
/
push-validate_workflows.yaml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: push-validate_workflows
# Validates workflow files on push
# yamllint disable-line rule:truthy
on:
push:
branches-ignore:
- v0
jobs:
init:
runs-on: 'ubuntu-latest'
steps:
- name: 'Write Report Header'
if: always()
uses: OXID-eSales/github-actions/begin_report@v4
with:
prefix: 'validate'
title: 'Workflow validation on ${{ github.repository }} by ${{ github.actor }}'
repository: '${{ github.server_url }}/${{ github.repository }}'
job: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
testplan: ''
debug: false
- name: 'Write Report'
if: always()
uses: OXID-eSales/github-actions/append_report@v4
with:
prefix: 'validate'
header: true
phase: lint
priority: '001'
debug: false
yamllint:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Lint yaml files
id: yamllint
uses: oxid-esales/github-actions/yamllint@v4
with:
format: 'github'
config_data: |
extends: default
ignore: .git/*
rules:
document-start: disable
line-length:
max: 160
level: warning
new-line-at-end-of-file:
level: warning
trailing-spaces:
level: warning
- name: 'Write yamllint Report'
if: always()
uses: OXID-eSales/github-actions/append_report@v4
with:
prefix: 'validate'
priority: '010'
phase: lint
title: ''
job: 'yamllint'
php: ''
mysql: ''
testplan: ''
status: ${{job.status}}
debug: false
actionlint:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Run actionlint
id: actionlint
uses: raven-actions/actionlint@v2
- name: actionlint Summary
if: always()
run: |
echo "Used actionlint version ${{ steps.actionlint.outputs.version-semver }}"
echo "Used actionlint release ${{ steps.actionlint.outputs.version-tag }}"
echo "actionlint ended with ${{ steps.actionlint.outputs.exit-code }} exit code"
echo "actionlint ended because '${{ steps.actionlint.outputs.exit-message }}'"
echo "actionlint found ${{ steps.actionlint.outputs.total-errors }} errors"
echo "actionlint checked ${{ steps.actionlint.outputs.total-files }} files"
echo "actionlint cache used: ${{ steps.actionlint.outputs.cache-hit }}"
- name: 'Write actionlint Report'
if: always()
uses: OXID-eSales/github-actions/append_report@v4
with:
prefix: 'validate'
priority: '020'
phase: lint
job: 'actionlint'
title: ''
php: ''
mysql: ''
testplan: ''
status: ${{job.status}}
debug: false
finish:
if: always()
needs:
- init
- yamllint
- actionlint
- matchingyaml
runs-on: 'ubuntu-latest'
env:
SLACK_WEBHOOK: "${{ secrets.SLACK_WEBHOOK_URL }}"
steps:
- name: 'Output report'
uses: 'OXID-eSales/github-actions/generate_report@v4'
with:
prefix: 'validate'
slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
title: 'Workflow validation on ${{ github.repository }} by ${{ github.actor }}'
compact: true
debug: false