Skip to content

Commit 383a1ea

Browse files
committed
ci: full clone
1 parent 2892112 commit 383a1ea

File tree

9 files changed

+120
-119
lines changed

9 files changed

+120
-119
lines changed

.github/workflows/build.yml

-114
This file was deleted.

.github/workflows/gitleaks.yml

+1
Original file line numberDiff line numberDiff line change
@@ -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

+2
Original file line numberDiff line numberDiff line change
@@ -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

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

.github/workflows/test.yml

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