diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a014b1c47..f59335787 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/template-cleanup.yml b/.github/workflows/template-cleanup.yml new file mode 100644 index 000000000..69db8f4b0 --- /dev/null +++ b/.github/workflows/template-cleanup.yml @@ -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/github-push-action@0.8.0 + with: + branch: main + github_token: ${{ secrets.GITHUB_TOKEN }}