Skip to content
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

Template Cleanup action #264

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ jobs:
# The operating system it will run on
runs-on: ubuntu-latest
# This check needs to be in place to prevent a publish loop with auto and github actions
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
if: |
!contains(github.event.head_commit.message, 'ci skip') &&
!contains(github.event.head_commit.message, 'skip ci') &&
!contains(github.event.head_commit.message, 'Initial commit')
# The list of steps that the action will go through
steps:
- name: Checkout
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/template-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Template Cleanup
on:
push:
branches: [main]

permissions:
contents: write

jobs:

template-cleanup:
name: Template Cleanup
runs-on: ubuntu-latest
if: github.event.repository.is_template == false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cleanup
run: |
rm -rf \
.github/workflows \
docs \
splash \
scripts \
.github/CONTRIBUTING.md \
.github/FUNDING.yml \
.github/SECURITY.md \
.autorc \
.coderabbit.yaml \
CHANGELOG.md \
license.md


- name: Commit and push changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "chore: cleanup template files [skip ci]" || echo "No changes to commit"

- name: Push changes
uses: ad-m/[email protected]
with:
branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}