Skip to content

Truncate Git History #30

Truncate Git History

Truncate Git History #30

name: Truncate Git History
on:
schedule:
- cron: '0 6 1 * *' # run every first of the month at 6:00 AM
workflow_dispatch:
jobs:
truncate_history:
if: github.ref == 'refs/heads/main' && github.repository_owner == 'vitruv-tools'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: 'main'
fetch-depth: 1
- name: Truncate Git history
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit --amend -m "Truncated history"
git push origin main --force