Skip to content

Commit ee7ed3c

Browse files
Add dependencies and code scan workflows and organize existing workflows (#1689)
* Add dependencies and code scan for PRs * Re-organize workflows * No need to handle macos/swift case
1 parent f431361 commit ee7ed3c

File tree

4 files changed

+73
-18
lines changed

4 files changed

+73
-18
lines changed

.github/workflows/codeql.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "dev", "main", "proj/*" ]
6+
pull_request:
7+
branches: [ "dev", "main", "proj/*" ]
8+
schedule:
9+
- cron: '39 0 * * 6'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
permissions:
16+
# required for all workflows
17+
security-events: write
18+
19+
# required to fetch internal or private CodeQL packs
20+
packages: read
21+
22+
# only required for workflows in private repositories
23+
actions: read
24+
contents: read
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
include:
30+
- language: go
31+
build-mode: autobuild
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: ${{ matrix.language }}
40+
build-mode: ${{ matrix.build-mode }}
41+
queries: security-and-quality
42+
43+
- name: Perform CodeQL Analysis
44+
uses: github/codeql-action/analyze@v3
45+
with:
46+
category: "/language:${{matrix.language}}"

.github/workflows/gosec_pr.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Request
1+
name: CI for Pull Requests
22
on: pull_request
33
jobs:
44
tests:
@@ -22,3 +22,28 @@ jobs:
2222
run: go mod tidy
2323
- name: Fail if changes
2424
run: git diff-index --exit-code HEAD
25+
26+
dependency-review:
27+
permissions:
28+
contents: read
29+
pull-requests: write
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: 'Checkout repository'
33+
uses: actions/checkout@v4
34+
- name: 'Dependency Review'
35+
uses: actions/dependency-review-action@v4
36+
with:
37+
comment-summary-in-pr: on-failure
38+
39+
gosec_scan:
40+
runs-on: ubuntu-latest
41+
env:
42+
GO111MODULE: on
43+
steps:
44+
- name: Checkout Source
45+
uses: actions/checkout@v4
46+
- name: Run Gosec Security Scanner
47+
uses: securego/gosec@master
48+
with:
49+
args: -exclude=G104 ./...

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Unit Tests
22
on:
33
workflow_dispatch: null
44
push:
5-
pull_request:
5+
66
jobs:
77
unit_tests:
88
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)