-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (64 loc) · 1.87 KB
/
pull_request.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
name: Validate on Pull Request
on:
workflow_dispatch:
pull_request:
types: [ opened, reopened, synchronize ]
jobs:
lint:
name: Lint files
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.23.2'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-cache: true
args: --timeout=30m
test:
name: Run tests
runs-on: ubuntu-22.04
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.23.2'
- run: go test -v -cover ./...
security-checks:
runs-on: ubuntu-24.04
needs: test
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Get Branch Name
shell: bash
run: |
echo "branch_name=${{ github.event.pull_request.head.ref }}" >> "$GITHUB_ENV"
- name: Build Local Baski Image
uses: drewbernetes/[email protected]
id: build-and-scan-baski
with:
image-repo: "drewviles"
repo-username: ${{ secrets.DOCKER_USER }}
repo-password: ${{ secrets.DOCKER_PASSWORD }}
image-name: baski
image-tag: ${{ env.branch_name }}
check-severity: "HIGH,CRITICAL"
trivyignore-from-s3: true
s3-endpoint: "https://api.s3.hudson-viles.uk/"
s3-access-key: ${{secrets.S3_ACCESS_KEY}}
s3-secret-key: ${{secrets.S3_SECRET_KEY}}
s3-bucket: "trivyignores"
s3-path: "baski"
add-latest-tag: false
publish-image: false
cosign-private-key: ${{secrets.COSIGN_KEY}}
cosign-password: ${{secrets.COSIGN_PASSWORD}}
cosign-tlog: false
dockerfile-path: docker