-
Notifications
You must be signed in to change notification settings - Fork 3
Script for initializing a new taskflows repo #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kevinbackhouse
wants to merge
3
commits into
GitHubSecurityLab:main
Choose a base branch
from
kevinbackhouse:create-repo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: GitHub, Inc. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| # Script for creating a new taskflows repo. | ||
| # Usage: | ||
| # | ||
| # cd <empty directory> | ||
| # python -m venv venv | ||
| # source venv/bin/activate | ||
| # pip install hatch uv | ||
| # git clone https://github.com/GitHubSecurityLab/seclab-taskflows.git | ||
| # ./seclab-taskflows/scripts/create_repo.sh "My Project" | ||
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # | ||
| # The script creates a sub-directory named "new-taskflows-repo", | ||
| # containing a new git repo with an initial commit. It contains | ||
| # the basic directory structure that you need to start your own | ||
| # taskflow project. | ||
|
|
||
| set -e | ||
|
|
||
| if [ -z "$1" ]; then | ||
| echo "Usage: $0 <Project Name>"; | ||
| exit 1; | ||
| fi | ||
|
|
||
| # Get location of seclab-taskflows repo. (Use the location of this | ||
| # script, which is in that repo.) | ||
| SECLAB_TASKFLOWS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd .. && pwd)" | ||
|
|
||
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| hatch new "$1" new-taskflows-repo | ||
| cd new-taskflows-repo | ||
|
|
||
| # Copy files from seclab-taskflows repo. | ||
| cp -r "$SECLAB_TASKFLOWS/.devcontainer" . | ||
| cp "$SECLAB_TASKFLOWS/CODE_OF_CONDUCT.md" . | ||
| cp "$SECLAB_TASKFLOWS/.gitignore" . | ||
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| cp "$SECLAB_TASKFLOWS/.github/workflows/publish-to-pypi.yaml" .github/workflows/ | ||
| cp "$SECLAB_TASKFLOWS/.github/workflows/publish-to-testpypi.yaml" .github/workflows/ | ||
|
|
||
| # Replace any occurrences of "seclab-taskflows" with the correct project name. | ||
| PROJECT_NAME="$(hatch project metadata name)" | ||
| find . -type f -exec sed -i "s/seclab-taskflows/$PROJECT_NAME/g" {} \; | ||
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Get the path to the source code. (Usually something like "src/my_project") | ||
| SRCDIR="$(dirname $(find . -name __about__.py))" | ||
|
|
||
| # Create directories | ||
| mkdir "$SRCDIR/configs" | ||
| echo "# Configs" > "$SRCDIR/configs/README.md" | ||
| mkdir "$SRCDIR/mcp_servers" | ||
| echo "# MCP servers" > "$SRCDIR/mcp_servers/README.md" | ||
| mkdir "$SRCDIR/personalities" | ||
| echo "# Personalities" > "$SRCDIR/personalities/README.md" | ||
| mkdir "$SRCDIR/prompts" | ||
| echo "# Prompts" > "$SRCDIR/prompts/README.md" | ||
| mkdir "$SRCDIR/taskflows" | ||
| echo "# Taskflows" > "$SRCDIR/taskflows/README.md" | ||
| mkdir "$SRCDIR/toolboxes" | ||
| echo "# Toolboxes" > "$SRCDIR/toolboxes/README.md" | ||
|
|
||
| # Add dependency on seclab-taskflow-agent | ||
| uv add seclab-taskflow-agent --active --frozen | ||
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Create initial git commit. | ||
| git init | ||
| git add . | ||
| git commit -m "Initial commit" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.