-
Notifications
You must be signed in to change notification settings - Fork 442
118 lines (108 loc) · 2.96 KB
/
pr.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
name: Pull Request
on:
pull_request:
branches:
- main
permissions:
contents: read
jobs:
build-website:
name: "Build website"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Get kubectl version
run: |
source hack/lib/kubectl-version.sh
echo "Using kubectl ${KUBECTL_VERSION}"
echo "KUBECTL_VERSION=$KUBECTL_VERSION" >> $GITHUB_ENV
- uses: azure/setup-kubectl@v4
with:
version: "${{ env.KUBECTL_VERSION }}"
id: install
- name: Run website build
working-directory: website
run: |
export LAB_TIMES_ENABLED='true'
npm install
npm run build
build-lab:
name: "Build lab"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Make shell
env:
SKIP_CREDENTIALS: 1
run: |
bash hack/exec.sh '' 'ls -la'
pre-commit:
name: "Pre-commit hooks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
- name: Setup terraform-docs
uses: jaxxstorm/[email protected]
with:
repo: terraform-docs/terraform-docs
- uses: pre-commit/[email protected]
spell-check:
name: "Spell checker"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- run: |
npx cspell lint "website/docs/**/*.md"
terraform-validate:
name: "Validate Terraform"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "~1.9.0"
- run: |
bash hack/validate-terraform.sh
semantic-pr:
name: Semantic Pull Request
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
new
update
fix
chore
feat
docs
content-label:
name: Check for content label
runs-on: ubuntu-latest
steps:
- name: Check for content label
uses: actions/github-script@v6
with:
script: |
const labels = context.payload.pull_request.labels;
const hasContentLabel = labels.some(label => label.name.startsWith('content/'));
if (!hasContentLabel) {
core.setFailed('This pull request must have a label that starts with "content/"');
} else {
console.log('Pull request has a valid content label');
}