Skip to content

🚧 Improve repository cleanup (#6) #11

🚧 Improve repository cleanup (#6)

🚧 Improve repository cleanup (#6) #11

Workflow file for this run

name: Repository Cleanup
on:
push:
branches:
- master
jobs:
cleanup:
runs-on: ubuntu-latest
# Prevent the action to run on the template repository
if: github.event.repository.name != 'template_python'
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Cleanup repository
run: |
chmod +x script/rename.sh
CAPITALIZED_NAME=$(echo ${{ github.event.repository.name }} | sed -E 's/([a-z0-9])([A-Z])/\1 \2/g; s/[-_]/ /g' | awk '{print toupper($0)}')
./script/rename.sh -f README.md --find "PYTHON TEMPLATE" --replace-with "$CAPITALIZED_NAME"
./script/rename.sh -f README.md --from 12 --to 16 --replace-with "\n"
./script/rename.sh -f README.md --find "Anatole-DC/template_python" --replace-with "$GITHUB_REPOSITORY"
./script/rename.sh -f README.md --find "template_python" --replace-with ${{ github.event.repository.name }}
- name: Remove cleanup files
run : |
rm -fr .github/workflows/cleanup.yml
rm -fr script/
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ":truck: Automatic template placeholder cleanup"
create_branch: false