Skip to content

Commit ca776d3

Browse files
ci: synced file(s) with honestbank/.github
1 parent 0b8d617 commit ca776d3

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

.github/workflows/terraform.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Terraform GitHub Action"
2+
on:
3+
pull_request:
4+
# This workflow is meant for public Terraform module repositories
5+
# which are generally component modules that follow trunk-based development.
6+
branches: [main]
7+
jobs:
8+
terraform:
9+
name: "terraform"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
submodules: "recursive"
16+
- name: Set up Terraform
17+
uses: hashicorp/setup-terraform@v3
18+
with:
19+
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
20+
- name: Terraform Format
21+
id: fmt
22+
run: terraform fmt
23+
continue-on-error: true
24+
- name: Terraform Init
25+
id: init
26+
run: terraform init
27+
- name: Terraform Validate
28+
id: validate
29+
run: terraform validate -no-color
30+
- name: Terraform Plan
31+
id: plan
32+
run: terraform plan -no-color
33+
continue-on-error: true

.github/workflows/terratest.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Terratest GitHub Action"
2+
on:
3+
pull_request:
4+
branches: [test, dev, qa, prod, main]
5+
push:
6+
branches: [test, dev, qa, prod, main]
7+
env:
8+
AWS_ACCESS_KEY_ID: ${{ secrets.TERRATEST_AWS_ACCESS_KEY_ID }}
9+
AWS_SECRET_KEY: ${{ secrets.TERRATEST_AWS_SECRET_ACCESS_KEY }}
10+
AWS_DEFAULT_REGION: ${{ secrets.TERRATEST_AWS_REGION }}
11+
AWS_REGION: ${{ secrets.TERRATEST_AWS_REGION }}
12+
jobs:
13+
terratest:
14+
name: terratest
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: 1.20
25+
id: go
26+
- name: Run 'go test -v -timeout 60m'
27+
run: |
28+
cd test
29+
go mod download
30+
go test -v -timeout 30m

.github/workflows/trivy.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Trivy Security Scan
3+
4+
# permissions required for the action, restricting to read-only for repository contents.
5+
permissions:
6+
contents: read
7+
8+
on:
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
trivy-security-scan:
15+
name: Run Trivy Security Scan
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: "recursive" # Ensure any submodules are included in the scan.
23+
token: ${{ secrets.ENGINEERING_GITHUB_PERSONAL_ACCESS_TOKEN }}
24+
25+
# Run Trivy Configuration Scan with specified options.
26+
- name: Run Trivy Security Scan
27+
uses: aquasecurity/[email protected]
28+
with:
29+
scan-type: 'config'
30+
trivy-config: 'trivy.yaml'

0 commit comments

Comments
 (0)