Skip to content
This repository was archived by the owner on Aug 16, 2026. It is now read-only.

Commit 886ce20

Browse files
Enhance CI workflows with security checks and daily triggers (#3)
* removed diff file, not required anymore * Add CI workflow for build and script linting * Add security workflow with CodeQL and Cppcheck * Add daily schedule trigger to workflow Added a scheduled trigger to run the workflow daily at 10:00 UTC. * Delete .github/workflows/main.yml * Add CI workflow for build and code quality checks * Update TruffleHog action in security workflow * Change TruffleHog scan head to 'testing' * Add .gitattributes for GitHub merge strategy
1 parent 9ef97f2 commit 886ce20

2 files changed

Lines changed: 133 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Core CI - Build & Code Quality
2+
3+
on:
4+
push:
5+
branches: [ "testing", "my_dwm" ]
6+
pull_request:
7+
branches: [ "testing", "my_dwm" ]
8+
schedule:
9+
# Runs every day at 10:00 UTC
10+
# (Matches 13:00 Bucharest time during Daylight Saving / EEST)
11+
- cron: '0 10 * * *'
12+
workflow_dispatch: # Allows you to manually trigger this workflow anytime from the Actions tab
13+
14+
jobs:
15+
build:
16+
name: Compilation Test
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
23+
- name: Install X11 & Development Dependencies
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y build-essential libx11-dev libxft-dev libxinerama-dev pkg-config
27+
28+
- name: Environment Pre-Check
29+
run: |
30+
gcc --version
31+
make --version
32+
pkg-config --cflags --libs x11 xft xinerama
33+
34+
- name: Build Binary
35+
run: |
36+
# Automatically fall back to config.def.h if config.h isn't committed yet
37+
if [ ! -f config.h ]; then
38+
cp config.def.h config.h
39+
fi
40+
make clean dwm
41+
42+
script-lint:
43+
name: Lint Custom Shell Scripts
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- name: Checkout Code
48+
uses: actions/checkout@v4
49+
50+
- name: Run ShellCheck
51+
uses: ludeeus/action-shellcheck@master
52+
with:
53+
scandir: '.'
54+
env:
55+
SHELLCHECK_OPTS: -e SC2009 # Ignore optional minor processes alerts if desired

.github/workflows/security.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Security
2+
3+
on:
4+
push:
5+
branches: [ "testing", "my_dwm" ]
6+
pull_request:
7+
branches: [ "testing", "my_dwm" ]
8+
schedule:
9+
# Runs every day at 10:00 UTC
10+
# (Matches 13:00 Bucharest time during Daylight Saving / EEST)
11+
- cron: '0 10 * * *'
12+
workflow_dispatch: # Allows you to manually trigger this workflow anytime from the Actions tab
13+
14+
jobs:
15+
codeql-analysis:
16+
name: CodeQL Security Scan
17+
runs-on: ubuntu-latest
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
22+
23+
steps:
24+
- name: Checkout Code
25+
uses: actions/checkout@v4
26+
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v3
29+
with:
30+
languages: c-cpp
31+
build-mode: manual
32+
33+
- name: Install Build Dependencies
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y build-essential libx11-dev libxft-dev libxinerama-dev pkg-config
37+
38+
- name: Build Workspace for Tracer
39+
run: |
40+
if [ ! -f config.h ]; then
41+
cp config.def.h config.h
42+
fi
43+
make clean dwm
44+
45+
- name: Perform CodeQL Analysis
46+
uses: github/codeql-action/analyze@v3
47+
48+
cppcheck-analysis:
49+
name: Cppcheck Code Quality
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- name: Checkout Code
54+
uses: actions/checkout@v4
55+
56+
- name: Run Cppcheck Static Analysis
57+
uses: deep5050/cppcheck-action@main
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
enable: all
61+
inline_suppression: enable
62+
63+
secret-scanner:
64+
name: Secret Scanning (TruffleHog)
65+
runs-on: ubuntu-latest
66+
67+
steps:
68+
- name: Checkout Code
69+
uses: actions/checkout@v4
70+
with:
71+
fetch-depth: 0
72+
73+
- name: TruffleHog OSS Scan
74+
uses: trufflesecurity/trufflehog@main
75+
with:
76+
base: ${{ github.event.repository.default_branch }}
77+
head: testing
78+
extra_args: --results=verified,unknown

0 commit comments

Comments
 (0)