Skip to content

Commit d908f39

Browse files
committed
feat: Update DevContainer and add Bootstrap script
1 parent 9c0a460 commit d908f39

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

.devcontainer/bootstrap.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Assumes CodeQL is installed via the VSCode Plugin
4+
CODEQL_CODESPACES_PATH="/root/.vscode-remote/data/User/globalStorage/github.vscode-codeql/distribution1/codeql/codeql"
5+
6+
if [ -d "$CODEQL_CODESPACES_PATH" ]; then
7+
export PATH=$CODEQL_CODESPACES_PATH:$PATH
8+
9+
else
10+
# Installs CodeQL CLI via GH extension
11+
gh extensions install github/gh-codeql
12+
gh codeql install-stub
13+
14+
fi
15+
16+
# Clone an instance of the CodeQL repository
17+
if [ ! -d "./codeql" ]; then
18+
git clone depth=1 https://github.com/github/codeql ./codeql
19+
else

.devcontainer/devcontainer.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,38 @@
11
{
22
"name": "CodeQL-Community-Packs",
3+
"postAttachCommand": ".devcontainer/bootstrap.sh",
4+
"hostRequirements": {
5+
"storage": "32gb",
6+
"memory": "16gb",
7+
"cpus": 4
8+
},
39
"extensions": [
410
"github.vscode-codeql",
511
"github.copilot"
612
],
713
"settings": {
14+
"codeQL.canary": true,
815
"codeQL.runningQueries.autoSave": true,
916
"codeQL.runningQueries.numberOfThreads": 4,
1017
"codeQL.runningQueries.debug": true,
1118
"editor.formatOnSave": true
1219
},
1320
"postCreateCommand": "git submodule init && git submodule update --recursive",
14-
"remoteUser": "root"
15-
}
21+
"remoteUser": "root",
22+
"customizations": {
23+
"codespaces": {
24+
"repositories": {
25+
"github/gh-codeql": {
26+
"permissions": {
27+
"contents": "read"
28+
}
29+
},
30+
"github/codeql": {
31+
"permissions": {
32+
"contents": "read"
33+
}
34+
}
35+
}
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)