Skip to content

Commit

Permalink
Add dependencies and code scan workflows and organize existing workfl…
Browse files Browse the repository at this point in the history
…ows (linode#1689)

* Add dependencies and code scan for PRs

* Re-organize workflows

* No need to handle macos/swift case
  • Loading branch information
zliang-akamai authored Dec 16, 2024
1 parent f431361 commit ee7ed3c
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 18 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "CodeQL Advanced"

on:
push:
branches: [ "dev", "main", "proj/*" ]
pull_request:
branches: [ "dev", "main", "proj/*" ]
schedule:
- cron: '39 0 * * 6'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
16 changes: 0 additions & 16 deletions .github/workflows/gosec_pr.yml

This file was deleted.

27 changes: 26 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pull Request
name: CI for Pull Requests
on: pull_request
jobs:
tests:
Expand All @@ -22,3 +22,28 @@ jobs:
run: go mod tidy
- name: Fail if changes
run: git diff-index --exit-code HEAD

dependency-review:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
with:
comment-summary-in-pr: on-failure

gosec_scan:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: -exclude=G104 ./...
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Unit Tests
on:
workflow_dispatch: null
push:
pull_request:

jobs:
unit_tests:
runs-on: ubuntu-latest
Expand Down

0 comments on commit ee7ed3c

Please sign in to comment.