Skip to content

Commit 94e534e

Browse files
committed
ci: full clone
1 parent 2892112 commit 94e534e

10 files changed

+139
-125
lines changed

.github/workflows/build.yml

-114
This file was deleted.

.github/workflows/codeql.yml

+3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ name: "CodeQL"
22

33
on:
44
push:
5+
tags:
6+
- v*
57
branches:
68
- main
9+
pull_request:
710

811
jobs:
912
# ------------------------------

.github/workflows/gitleaks.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Gitleaks
22

33
on:
44
push:
5-
branches:
6-
- "main"
75
tags:
8-
- "v*"
6+
- v*
7+
branches:
8+
- main
99
pull_request:
1010

1111
permissions:
@@ -20,6 +20,7 @@ jobs:
2020
- uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23+
ref: ${{ github.event.pull_request.head.sha }}
2324

2425
- uses: gitleaks/gitleaks-action@v2
2526
env:

.github/workflows/grype.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Grype
22

33
on:
44
push:
5-
branches:
6-
- "main"
75
tags:
8-
- "v*"
6+
- v*
7+
branches:
8+
- main
99
pull_request:
1010

1111
jobs:
@@ -22,6 +22,8 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v4
25+
with:
26+
ref: ${{ github.event.pull_request.head.sha }}
2527

2628
- uses: anchore/scan-action@v3
2729
with:

.github/workflows/lint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v4
29+
with:
30+
ref: ${{ github.event.pull_request.head.sha }}
2931

3032
- uses: actions/setup-go@v5
3133
with:

.github/workflows/release.yml

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919
DOCKER_CLI_EXPERIMENTAL: "enabled"
2020
steps:
2121
- uses: actions/checkout@v4
22-
with:
23-
fetch-depth: 0
2422

2523
- uses: arduino/setup-task@v2
2624
with:

.github/workflows/security.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Security
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- main
9+
pull_request:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
# ------------------------------
16+
17+
govulncheck:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.event.pull_request.head.sha }}
23+
24+
- uses: actions/setup-go@v5
25+
with:
26+
go-version-file: go.mod
27+
28+
- uses: arduino/setup-task@v2
29+
with:
30+
version: 3.x
31+
repo-token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: setup
34+
run: task setup
35+
36+
- name: install govulncheck
37+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
38+
39+
- name: run govulncheck
40+
run: govulncheck ./...
41+
42+
# ------------------------------
43+
44+
semgrep:
45+
runs-on: ubuntu-latest
46+
container:
47+
image: returntocorp/semgrep
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
ref: ${{ github.event.pull_request.head.sha }}
52+
53+
- uses: actions/checkout@v4
54+
with:
55+
repository: dgryski/semgrep-go
56+
path: rules
57+
58+
- uses: actions/setup-go@v5
59+
with:
60+
go-version-file: go.mod
61+
62+
- name: semgrep
63+
run: semgrep scan --error --enable-nosem -f ./rules .

.github/workflows/test.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- main
9+
pull_request:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.pull_request.head.sha }}
21+
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
26+
- name: setup-tparse
27+
run: go install github.com/mfridman/tparse@latest
28+
29+
- uses: arduino/setup-task@v2
30+
with:
31+
version: 3.x
32+
repo-token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: setup
35+
run: |
36+
task setup
37+
task build
38+
39+
- name: test
40+
run: ./scripts/test.sh
41+
42+
- name: Upload coverage reports to Codecov
43+
uses: codecov/codecov-action@v4
44+
with:
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
47+
- name: Ensure scm-engine binary work
48+
run: ./scm-engine
49+
50+
- name: Test scm-engine against test GitLab project
51+
run: ./scm-engine evaluate 1
52+
env:
53+
SCM_ENGINE_TOKEN: "${{ secrets.GITLAB_INTEGRATION_TEST_API_TOKEN }}"
54+
SCM_ENGINE_CONFIG_FILE: ".scm-engine.example.yml"
55+
GITLAB_PROJECT: "jippi/scm-engine-schema-test"
56+
GITLAB_BASEURL: https://gitlab.com/
57+
58+
- name: Show any diff that may be in the project
59+
run: git diff

Taskfile.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ tasks:
2020

2121
build:
2222
desc: Build the binary
23+
cmds:
24+
- go build -o scm-engine .
2325
sources:
2426
- ./**/*.go
2527
generates:
2628
- ./scm-engine
27-
cmds:
28-
- go build -o scm-engine .
2929

3030
test:
3131
desc: Run tests

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func main() {
2727
app := &cli.App{
2828
Name: "scm-engine",
2929
Usage: "GitHub/GitLab automation",
30-
Copyright: "Christian Winther",
30+
Copyright: "Christian Winther?!",
3131
EnableBashCompletion: true,
3232
Suggest: true,
3333
Version: fmt.Sprintf("%s (date: %s; commit: %s)", version, date, commit),

0 commit comments

Comments
 (0)