Skip to content

Commit e6eea8d

Browse files
committed
Add advanced CodeQL Workflow
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
1 parent 39bbdab commit e6eea8d

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

.github/workflows/codeql.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Copyright 2025 Chainguard, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: "CodeQL Advanced"
5+
6+
on:
7+
pull_request:
8+
push:
9+
# branches: ["main"]
10+
schedule:
11+
- cron: "35 23 * * 0"
12+
13+
env:
14+
CODEQL_EXTRACTOR_GO_BUILD_TRACING: "on"
15+
16+
permissions: {}
17+
18+
jobs:
19+
analyze:
20+
if: ${{ github.repository }} == 'chainguard-dev/malcontent'
21+
runs-on: mal-ubuntu-latest-8-core
22+
container:
23+
image: cgr.dev/chainguard/wolfi-base@sha256:91ed94ec4e72368a9b5113f2ffb1d8e783a91db489011a89d9fad3e3816a75ba
24+
options: >-
25+
--cap-add DAC_OVERRIDE
26+
--cap-add SETGID
27+
--cap-add SETUID
28+
--cap-drop ALL
29+
--cgroupns private
30+
--cpu-shares=8192
31+
--memory-swappiness=0
32+
--security-opt no-new-privileges
33+
--ulimit core=0
34+
--ulimit nofile=1024:1024
35+
--ulimit nproc=4096:4096
36+
permissions:
37+
actions: read
38+
contents: read
39+
packages: read
40+
security-events: write
41+
steps:
42+
- name: Install dependencies
43+
run: |
44+
apk update
45+
apk add bash curl findutils gh git go nodejs perl upx xz yara-x
46+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
- name: Trust repository
48+
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
49+
- name: Initialize CodeQL
50+
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
51+
with:
52+
languages: go
53+
build-mode: manual
54+
- run: |
55+
go build -o /dev/null ./...
56+
go test -o /dev/null -c ./...
57+
- name: Perform CodeQL Analysis
58+
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
59+
with:
60+
category: "/language:go"
61+
analyze-actions:
62+
runs-on: ubuntu-latest
63+
permissions:
64+
actions: read
65+
contents: read
66+
packages: read
67+
security-events: write
68+
steps:
69+
- uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
70+
with:
71+
egress-policy: audit
72+
- name: Checkout repository
73+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
74+
- name: Initialize CodeQL
75+
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
76+
with:
77+
languages: actions
78+
build-mode: none
79+
- name: Perform CodeQL Analysis
80+
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
81+
with:
82+
category: "/language:actions"

0 commit comments

Comments
 (0)