Skip to content

Commit 20ec7ee

Browse files
authored
Add codeql workflow (#1685)
Signed-off-by: dkwon17 <dakwon@redhat.com>
1 parent 65e0bea commit 20ec7ee

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#
2+
# Copyright (c) 2019-2026 Red Hat, Inc.
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
name: DevWorkspace Operator CodeQL scan
17+
18+
on:
19+
push:
20+
branches: [ main ]
21+
paths:
22+
- '**.go'
23+
- 'go.mod'
24+
- 'go.sum'
25+
- '.github/workflows/codeql.yml'
26+
pull_request:
27+
branches: [ main ]
28+
paths:
29+
- '**.go'
30+
- 'go.mod'
31+
- 'go.sum'
32+
- '.github/workflows/codeql.yml'
33+
schedule:
34+
- cron: '15 7 * * 1'
35+
36+
permissions:
37+
contents: read
38+
39+
jobs:
40+
analyze:
41+
name: Analyze (${{ matrix.language }})
42+
runs-on: ubuntu-latest
43+
permissions:
44+
contents: read
45+
security-events: write
46+
packages: read
47+
48+
strategy:
49+
fail-fast: false
50+
matrix:
51+
include:
52+
- language: go
53+
build-mode: manual
54+
55+
steps:
56+
- name: Checkout repository
57+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
58+
with:
59+
persist-credentials: false
60+
- name: Set up Go 1.x
61+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
62+
with:
63+
go-version-file: go.mod
64+
65+
- name: Initialize CodeQL
66+
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
67+
with:
68+
languages: ${{ matrix.language }}
69+
build-mode: ${{ matrix.build-mode }}
70+
71+
- name: Run manual build steps
72+
if: matrix.build-mode == 'manual'
73+
shell: bash
74+
run: |
75+
make manager
76+
make compile-devworkspace-controller
77+
make compile-webhook-server
78+
- name: Perform CodeQL Analysis
79+
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
80+
with:
81+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)