Skip to content

Commit e74414f

Browse files
chore(ci): Maximize CI/CD values (Dependabot & Permissions) (#1)
* chore(ci): maximize ci/cd values via dependabot and permissions * fix(ci): Resolve workflow-linter self-matching and metadata issues
1 parent 7f48c13 commit e74414f

7 files changed

Lines changed: 68 additions & 86 deletions

File tree

.github/workflows/boj-build.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
12
name: BoJ Server Build Trigger
2-
33
on:
44
push:
5-
branches: [ main, master ]
5+
branches: [main, master]
66
workflow_dispatch:
7-
87
jobs:
98
trigger-boj:
109
runs-on: ubuntu-latest
1110
steps:
1211
- name: Checkout
13-
uses: actions/checkout@v4
14-
12+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1513
- name: Trigger BoJ Server (Casket/ssg-mcp)
1614
run: |
1715
# Send a secure trigger to boj-server to build this repository
1816
curl -X POST "http://boj-server.local:7700/cartridges/ssg-mcp/invoke" -H "Content-Type: application/json" -d "{\"repo\": \"${{ github.repository }}\", \"branch\": \"${{ github.ref_name }}\", \"engine\": \"casket\\"}"}
1917
continue-on-error: true
18+
permissions: read-all

.github/workflows/codeql.yml

Lines changed: 49 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
# supported CodeQL languages.
1212
#
1313
name: "CodeQL Advanced"
14-
1514
on:
1615
push:
17-
branches: [ "main" ]
16+
branches: ["main"]
1817
pull_request:
19-
branches: [ "main" ]
18+
branches: ["main"]
2019
schedule:
2120
- cron: '16 7 * * 1'
22-
2321
jobs:
2422
analyze:
2523
name: Analyze (${{ matrix.language }})
@@ -32,69 +30,64 @@ jobs:
3230
permissions:
3331
# required for all workflows
3432
security-events: write
35-
3633
# required to fetch internal or private CodeQL packs
3734
packages: read
38-
3935
# only required for workflows in private repositories
4036
actions: read
4137
contents: read
42-
4338
strategy:
4439
fail-fast: false
4540
matrix:
4641
include:
47-
- language: actions
48-
build-mode: none
49-
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
50-
# Use `c-cpp` to analyze code written in C, C++ or both
51-
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
52-
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
53-
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
54-
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
55-
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
56-
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
42+
- language: actions
43+
build-mode: none
44+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
45+
# Use `c-cpp` to analyze code written in C, C++ or both
46+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
47+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
48+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
49+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
50+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
51+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
5752
steps:
58-
- name: Checkout repository
59-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
60-
61-
# Add any setup steps before running the `github/codeql-action/init` action.
62-
# This includes steps like installing compilers or runtimes (`actions/setup-node`
63-
# or others). This is typically only required for manual builds.
64-
# - name: Setup runtime (example)
65-
# uses: actions/setup-example@v1
66-
67-
# Initializes the CodeQL tools for scanning.
68-
- name: Initialize CodeQL
69-
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4
70-
with:
71-
languages: ${{ matrix.language }}
72-
build-mode: ${{ matrix.build-mode }}
73-
# If you wish to specify custom queries, you can do so here or in a config file.
74-
# By default, queries listed here will override any specified in a config file.
75-
# Prefix the list here with "+" to use these queries and those in the config file.
53+
- name: Checkout repository
54+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
55+
# Add any setup steps before running the `github/codeql-action/init` action.
56+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
57+
# or others). This is typically only required for manual builds.
58+
# - name: Setup runtime (example)
59+
# uses: actions/setup-example@v1
7660

61+
# Initializes the CodeQL tools for scanning.
62+
- name: Initialize CodeQL
63+
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4
64+
with:
65+
languages: ${{ matrix.language }}
66+
build-mode: ${{ matrix.build-mode }}
67+
# If you wish to specify custom queries, you can do so here or in a config file.
68+
# By default, queries listed here will override any specified in a config file.
69+
# Prefix the list here with "+" to use these queries and those in the config file.
70+
# If the analyze step fails for one of the languages you are analyzing with
71+
# "We were unable to automatically build your code", modify the matrix above
72+
# to set the build mode to "manual" for that language. Then modify this step
73+
# to build your code.
74+
# ℹ️ Command-line programs to run using the OS shell.
75+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
76+
- name: Run manual build steps
7777
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
7878
# queries: security-extended,security-and-quality
7979

80-
# If the analyze step fails for one of the languages you are analyzing with
81-
# "We were unable to automatically build your code", modify the matrix above
82-
# to set the build mode to "manual" for that language. Then modify this step
83-
# to build your code.
84-
# ℹ️ Command-line programs to run using the OS shell.
85-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
86-
- name: Run manual build steps
87-
if: matrix.build-mode == 'manual'
88-
shell: bash
89-
run: |
90-
echo 'If you are using a "manual" build mode for one or more of the' \
91-
'languages you are analyzing, replace this with the commands to build' \
92-
'your code, for example:'
93-
echo ' make bootstrap'
94-
echo ' make release'
95-
exit 1
96-
97-
- name: Perform CodeQL Analysis
98-
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4
99-
with:
100-
category: "/language:${{matrix.language}}"
80+
if: matrix.build-mode == 'manual'
81+
shell: bash
82+
run: |
83+
echo 'If you are using a "manual" build mode for one or more of the' \
84+
'languages you are analyzing, replace this with the commands to build' \
85+
'your code, for example:'
86+
echo ' make bootstrap'
87+
echo ' make release'
88+
exit 1
89+
- name: Perform CodeQL Analysis
90+
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4
91+
with:
92+
category: "/language:${{matrix.language}}"
93+
permissions: read-all

.github/workflows/guix-nix-policy.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
# Check for package manager files
1212
HAS_GUIX=$(find . -name "*.scm" -o -name ".guix-channel" -o -name "guix.scm" 2>/dev/null | head -1)
1313
HAS_NIX=$(find . -name "*.nix" 2>/dev/null | head -1)
14-
14+
1515
# Block new package-lock.json, yarn.lock, Gemfile.lock, etc.
1616
NEW_LOCKS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E 'package-lock\.json|yarn\.lock|Gemfile\.lock|Pipfile\.lock|poetry\.lock|cargo\.lock' || true)
1717
if [ -n "$NEW_LOCKS" ]; then
1818
echo "⚠️ Lock files detected. Prefer Guix manifests for reproducibility."
1919
fi
20-
20+
2121
# Prefer Guix, fallback to Nix
2222
if [ -n "$HAS_GUIX" ]; then
2323
echo "✅ Guix package management detected (primary)"
@@ -26,5 +26,6 @@ jobs:
2626
else
2727
echo "ℹ️ Consider adding guix.scm or flake.nix for reproducible builds"
2828
fi
29-
29+
3030
echo "✅ Package policy check passed"
31+
permissions: read-all

.github/workflows/quality.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,31 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
name: Code Quality
33
on: [push, pull_request]
4-
54
jobs:
65
lint:
76
runs-on: ubuntu-latest
87
steps:
98
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
10-
119
- name: Check file permissions
1210
run: |
1311
find . -type f -perm /111 -name "*.sh" | head -10 || true
14-
1512
- name: Check for secrets
1613
uses: trufflesecurity/trufflehog@7ee2e0fdffec27d19ccbb8fb3dcf8a83b9d7f9e8 # main
1714
with:
1815
path: ./
1916
base: ${{ github.event.pull_request.base.sha || github.event.before }}
2017
head: ${{ github.sha }}
2118
continue-on-error: true
22-
2319
- name: Check TODO/FIXME
2420
run: |
2521
echo "=== TODOs ==="
2622
grep -rn "TODO\|FIXME\|HACK\|XXX" --include="*.rs" --include="*.res" --include="*.py" --include="*.ex" . | head -20 || echo "None found"
27-
2823
- name: Check for large files
2924
run: |
3025
find . -type f -size +1M -not -path "./.git/*" | head -10 || echo "No large files"
31-
3226
- name: EditorConfig check
3327
uses: editorconfig-checker/action-editorconfig-checker@4054fa83a075fdf090bd098bdb1c09aaf64a4169 # main
3428
continue-on-error: true
35-
3629
docs:
3730
runs-on: ubuntu-latest
3831
steps:
@@ -43,9 +36,10 @@ jobs:
4336
[ ! -f "README.md" ] && [ ! -f "README.adoc" ] && MISSING="$MISSING README"
4437
[ ! -f "LICENSE" ] && [ ! -f "LICENSE.txt" ] && [ ! -f "LICENSE.md" ] && MISSING="$MISSING LICENSE"
4538
[ ! -f "CONTRIBUTING.md" ] && [ ! -f "CONTRIBUTING.adoc" ] && MISSING="$MISSING CONTRIBUTING"
46-
39+
4740
if [ -n "$MISSING" ]; then
4841
echo "::warning::Missing docs:$MISSING"
4942
else
5043
echo "✅ Core documentation present"
5144
fi
45+
permissions: read-all

.github/workflows/rsr-antipattern.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@
55
# Allows: ReScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme
66

77
name: RSR Anti-Pattern Check
8-
98
on:
109
push:
1110
branches: [main, master, develop]
1211
pull_request:
1312
branches: [main, master, develop]
14-
1513
jobs:
1614
antipattern-check:
1715
runs-on: ubuntu-latest
1816
steps:
1917
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
20-
2118
- name: Check for TypeScript
2219
run: |
2320
if find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules | grep -q .; then
@@ -26,7 +23,6 @@ jobs:
2623
exit 1
2724
fi
2825
echo "✅ No TypeScript files"
29-
3026
- name: Check for Go
3127
run: |
3228
if find . -name "*.go" | grep -q .; then
@@ -35,7 +31,6 @@ jobs:
3531
exit 1
3632
fi
3733
echo "✅ No Go files"
38-
3934
- name: Check for Python (non-SaltStack)
4035
run: |
4136
PY_FILES=$(find . -name "*.py" | grep -v salt | grep -v _states | grep -v _modules | grep -v pillar | grep -v venv | grep -v __pycache__ || true)
@@ -45,23 +40,20 @@ jobs:
4540
exit 1
4641
fi
4742
echo "✅ No non-SaltStack Python files"
48-
4943
- name: Check for npm lockfiles
5044
run: |
5145
if [ -f "package-lock.json" ] || [ -f "yarn.lock" ]; then
5246
echo "❌ npm/yarn lockfile detected - use Deno instead"
5347
exit 1
5448
fi
5549
echo "✅ No npm lockfiles"
56-
5750
- name: Check for tsconfig
5851
run: |
5952
if [ -f "tsconfig.json" ]; then
6053
echo "❌ tsconfig.json detected - use ReScript instead"
6154
exit 1
6255
fi
6356
echo "✅ No tsconfig.json"
64-
6557
- name: Verify Deno presence (if package.json exists)
6658
run: |
6759
if [ -f "package.json" ]; then
@@ -70,7 +62,6 @@ jobs:
7062
fi
7163
fi
7264
echo "✅ Deno configuration check complete"
73-
7465
- name: Summary
7566
run: |
7667
echo "╔════════════════════════════════════════════════════════════╗"
@@ -81,3 +72,4 @@ jobs:
8172
echo "║ ║"
8273
echo "║ Blocked: TypeScript, Go, npm, Python (non-Salt) ║"
8374
echo "╚════════════════════════════════════════════════════════════╝"
75+
permissions: read-all

.github/workflows/security-policy.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,31 @@ jobs:
99
- name: Security checks
1010
run: |
1111
FAILED=false
12-
12+
1313
# Block MD5/SHA1 for security (allow for checksums/caching)
1414
WEAK_CRYPTO=$(grep -rE 'md5\(|sha1\(' --include="*.py" --include="*.rb" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" . 2>/dev/null | grep -v 'checksum\|cache\|test\|spec' | head -5 || true)
1515
if [ -n "$WEAK_CRYPTO" ]; then
1616
echo "⚠️ Weak crypto (MD5/SHA1) detected. Use SHA256+ for security:"
1717
echo "$WEAK_CRYPTO"
1818
fi
19-
19+
2020
# Block HTTP URLs (except localhost)
2121
HTTP_URLS=$(grep -rE 'http://[^l][^o][^c]' --include="*.py" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.yaml" --include="*.yml" . 2>/dev/null | grep -v 'localhost\|127.0.0.1\|example\|test\|spec' | head -5 || true)
2222
if [ -n "$HTTP_URLS" ]; then
2323
echo "⚠️ HTTP URLs found. Use HTTPS:"
2424
echo "$HTTP_URLS"
2525
fi
26-
26+
2727
# Block hardcoded secrets patterns
2828
SECRETS=$(grep -rEi '(api_key|apikey|secret_key|password)\s*[=:]\s*["'][A-Za-z0-9+/=]{20,}' --include="*.py" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.env" . 2>/dev/null | grep -v 'example\|sample\|test\|mock\|placeholder' | head -3 || true)
2929
if [ -n "$SECRETS" ]; then
3030
echo "❌ Potential hardcoded secrets detected!"
3131
FAILED=true
3232
fi
33-
33+
3434
if [ "$FAILED" = true ]; then
3535
exit 1
3636
fi
37-
37+
3838
echo "✅ Security policy check passed"
39+
permissions: read-all

.github/workflows/wellknown-enforcement.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
# Weekly expiry check
1414
- cron: '0 9 * * 1'
1515
workflow_dispatch:
16+
permissions: read-all
17+
1618

1719
jobs:
1820
validate:

0 commit comments

Comments
 (0)