Truncate Git History #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Truncate Git history | |
run: | | |
git clone https://${{github.token}}@github.com/${{github.repository}}.git -b main --depth 1 | |
cd updatesite | |
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 |