-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (96 loc) · 2.88 KB
/
pr-plan.yml
File metadata and controls
117 lines (96 loc) · 2.88 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
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
name: PR Plan
on:
pull_request:
permissions:
contents: read
jobs:
terraform:
name: Terraform checks (${{ matrix.path }})
runs-on: ubuntu-latest
env:
INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }}
strategy:
matrix:
path:
- infra/bootstrap
- infra/main
defaults:
run:
working-directory: ${{ matrix.path }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Terraform fmt
run: terraform fmt -check -recursive
- name: Terraform init (no backend)
run: terraform init -backend=false
- name: Terraform validate
run: terraform validate
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
- name: TFLint
run: |
tflint --init
tflint
- name: TFSec
uses: aquasecurity/tfsec-action@v1.0.3
with:
working_directory: ${{ matrix.path }}
- name: Checkov
uses: bridgecrewio/checkov-action@v12
with:
directory: ${{ matrix.path }}
- name: Setup Infracost
if: env.INFRACOST_API_KEY != ''
uses: infracost/actions/setup@v3
- name: Infracost breakdown
if: env.INFRACOST_API_KEY != ''
run: infracost breakdown --path .
docker-tests:
name: Docker lint/scan/dgoss
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare OpenClaw source
id: openclaw
uses: ./.github/actions/prepare-openclaw-source
with:
token: ${{ github.token }}
- name: Hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: app/Dockerfile
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v6
with:
context: ./app
push: false
build-args: |
OPENCLAW_VERSION=${{ steps.openclaw.outputs.version }}
tags: |
openclaw:pr
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Trivy scan
uses: aquasecurity/trivy-action@0.28.0
with:
image-ref: openclaw:pr
format: table
exit-code: 1
vuln-type: "os,library"
severity: "CRITICAL,HIGH"
- name: Install dgoss
run: |
curl -fsSL https://github.com/goss-org/goss/releases/latest/download/goss-linux-amd64 -o /usr/local/bin/goss
curl -fsSL https://github.com/goss-org/goss/releases/latest/download/dgoss -o /usr/local/bin/dgoss
chmod +x /usr/local/bin/goss /usr/local/bin/dgoss
- name: Run dgoss
env:
GOSS_FILES_PATH: app
GOSS_FILE: goss.yaml
run: dgoss run openclaw:pr