FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql-learninglab-actions/scripts/test-course-shared.sh at master · github/codeql-learninglab-actions · GitHub
This repository was archived by the owner on Sep 1, 2022. It is now read-only.
github
codeql-learninglab-actions
Repository navigation
Code
Issues
3
(3)
Pull requests
2
(2)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql-learninglab-actions
/
scripts
/
test-course-shared.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
43 lines (36 loc) · 882 Bytes
Breadcrumbs
codeql-learninglab-actions
/
scripts
/
test-course-shared.sh
Copy path
File metadata and controls
executable file
·
43 lines (36 loc) · 882 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!
/bin/bash
#
Build the course image, and run all or specific queries in
#
the course to ensure the expected result
#
#
Should be run with the cwd being the course folder
set
-e
set
-x
TMP=
$(
mktemp -d -t ci-XXXXXXXXXX
)
TAG=ci-test
#
Build course image
docker build -t
$TAG
image
#
Prepare temporary folder to mount into docker
mkdir -p
$TMP
cp -R answers
$TMP
/answers
echo
"
{}
"
>
$TMP
/event.json
#
Get query argument
RUN_ALL=true
QUERY_PATTERN=
"
"
if
[
"
$1
"
!=
"
"
]
;
then
RUN_ALL=false
QUERY_PATTERN=
$1
echo
"
Running specific queries
$QUERY_PATTERN
"
else
echo
"
Running all queries
"
fi
#
Run docker image
docker run -i \
-e GITHUB_EVENT_NAME=push \
-e GITHUB_EVENT_PATH=/opt/tmp/event.json \
-e GITHUB_TOKEN=noop \
-e RUN_ALL=
$RUN_ALL
\
-e QUERY_PATTERN=
$QUERY_PATTERN
\
-e SKIP_COMMENT=true \
-v
$TMP
:/opt/tmp:ro \
-w /opt/tmp/answers \
$TAG
Back
|
FazBrowse Home
|
New Git URL