Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/template-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ jobs:
run: |
repo_slug="${{ steps.names.outputs.repo_slug }}"
repo_snake="${{ steps.names.outputs.repo_snake }}"
repo_desc="${{ github.event.repository.description }}"

# replace dash-style placeholder
grep -lr --exclude-dir=.git 'python-template' . | xargs -r sed -i "s/python-template/${repo_slug}/g"
# replace snake_case placeholder
grep -lr --exclude-dir=.git 'python_template' . | xargs -r sed -i "s/python_template/${repo_snake}/g"
# replace pyproject.toml description placeholder
if [ -n "$repo_desc" ]; then
sed -i "s/Add your description here/${repo_desc}/" pyproject.toml
else
sed -i '/^description = "Add your description here"/d' pyproject.toml
fi

- name: Rename files and directories
run: |
Expand Down