-
Notifications
You must be signed in to change notification settings - Fork 62
53 lines (48 loc) · 1.64 KB
/
pr-lint.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
name: "Lint Pull Request"
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- "**.go"
- "**go.mod"
- "**go.sum"
- "<templates|test>/**/*.<yml|yaml>"
- ".github/actions/**/*"
- ".github/workflows/e2e-*"
- ".github/workflows/pr-*"
- ".golangci.yaml"
- "images/caph/**"
- "!**/vendor/**"
- "test/e2e/**"
- "docs/**"
# yamllint disable rule:line-length
jobs:
pr-lint:
name: "Lint Pull Request"
runs-on: ubuntu-latest
container:
image: ghcr.io/syself/caph-builder:1.0.22
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Fixup git permissions
# https://github.com/actions/checkout/issues/766
shell: bash
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Verify Golang Modules
run: make BUILD_IN_CONTAINER=false generate-modules-ci
# to ensure we don't miss any files that were supposed to be autogenerated.
# if there's a diff then the workflow will exit here.
- name: Run make verify
run: make BUILD_IN_CONTAINER=false verify
- name: Lint Golang Code
run: make BUILD_IN_CONTAINER=false lint-golang-ci
- name: Lint YAML
run: make BUILD_IN_CONTAINER=false lint-yaml-ci