Skip to content

Commit 4bced23

Browse files
Merge pull request #41 from kevinbackhouse/run-in-docker
Revert run_seclab_agent.sh back to its previous behavior
2 parents 2ddfe8f + 3c34231 commit 4bced23

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Individual taskflows may need additional setup, please refer to the `README.md`
3131
After setting the relevant env vars, run an example taskflow with:
3232

3333
```bash
34-
./scripts/run_seclab_agent.sh python -m seclab_taskflow_agent -t seclab_taskflows.taskflows.audit.ghsa_variant_analysis_demo -g repo=github/cmark-gfm -g ghsa=GHSA-c944-cv5f-hpvr
34+
./scripts/run_seclab_agent.sh -t seclab_taskflows.taskflows.audit.ghsa_variant_analysis_demo -g repo=github/cmark-gfm -g ghsa=GHSA-c944-cv5f-hpvr
3535
```
3636

3737
## Background
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
# SPDX-FileCopyrightText: GitHub, Inc.
3+
# SPDX-License-Identifier: MIT
4+
5+
# https://stackoverflow.com/a/53122736
6+
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7+
8+
${__dir}/../run_in_docker.sh ${__dir}/run_audit.sh "$1"

scripts/run_in_docker.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
# SPDX-FileCopyrightText: GitHub, Inc.
3+
# SPDX-License-Identifier: MIT
4+
5+
if [ ! -f ".env" ]; then
6+
touch ".env"
7+
fi
8+
9+
mkdir -p .local
10+
mkdir -p logs
11+
mkdir -p data
12+
13+
# Note: this uses the trick described [here](https://unix.stackexchange.com/a/646335)
14+
# to pass extra command line arguments into `bash -c`.
15+
docker run -i \
16+
--mount type=bind,src="$PWD",dst=/app \
17+
--mount type=bind,src="$PWD/.local",dst=/root/.local \
18+
-e GH_TOKEN="$GH_TOKEN" -e AI_API_TOKEN="$AI_API_TOKEN" --entrypoint /bin/bash \
19+
"ghcr.io/githubsecuritylab/seclab-taskflow-agent" \
20+
-c 'pip install -q -e /app && exec "$@"' this-is-bash-dollar-zero "$@"

scripts/run_seclab_agent.sh

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
#!/bin/bash
2-
# SPDX-FileCopyrightText: 2025 GitHub
2+
# SPDX-FileCopyrightText: GitHub, Inc.
33
# SPDX-License-Identifier: MIT
44

5-
if [ ! -f ".env" ]; then
6-
touch ".env"
7-
fi
5+
# https://stackoverflow.com/a/53122736
6+
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
87

9-
mkdir -p .local
10-
mkdir -p logs
11-
mkdir -p data
12-
13-
# Note: this uses the trick described [here](https://unix.stackexchange.com/a/646335)
14-
# to pass extra command line arguments into `bash -c`.
15-
docker run -i \
16-
--mount type=bind,src="$PWD",dst=/app \
17-
--mount type=bind,src="$PWD/.local",dst=/root/.local \
18-
-e GH_TOKEN="$GH_TOKEN" -e AI_API_TOKEN="$AI_API_TOKEN" --entrypoint /bin/bash \
19-
"ghcr.io/githubsecuritylab/seclab-taskflow-agent" \
20-
-c 'pip install -q -e /app && exec "$@"' this-is-bash-dollar-zero "$@"
8+
${__dir}/run_in_docker.sh python -m seclab_taskflow_agent "$@"

0 commit comments

Comments
 (0)