Skip to content

Merge pull request #16 from pep-dortmund/header_new_line #15

Merge pull request #16 from pep-dortmund/header_new_line

Merge pull request #16 from pep-dortmund/header_new_line #15

# inspired by:
# https://github.com/JetBrains/intellij-platform-plugin-template/blob/main/.github/workflows/template-cleanup.yml
name: Template Cleanup
on:
push:
branches: [main]
jobs:
# Run a cleaning process only if the workflow is triggered by the non-"toolbox-workshop-protocol-template" repository.
template-cleanup:
name: Template Cleanup
runs-on: ubuntu-latest
if: github.event.repository.name != 'toolbox-workshop-protocol-template'
permissions:
contents: write
steps:
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Cleanup project
- name: Cleanup
run: |
mv README.md notes.md
rm -rf .github
rm -f environment.yml
touch README.md
NAME="${GITHUB_REPOSITORY##*/}"
echo "# $NAME" >> README.md
echo "Generated from [toolbox-workshop-protocol-template](https://github.com/pep-dortmund/toolbox-workshop-protocol-template)" >> README.md
echo "Find more information in [notes.md](notes.md)." >> README.md
# Commit modified files
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Template cleanup"
# Push changes
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}