Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wjfu99 committed Jun 25, 2024
1 parent 23e7aa4 commit cf03eb2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Clean Commit History

on:
push:
branches:
- main


jobs:
clean_history:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Remove commit history
run: |
# Set up Git user
git config --global user.name "Wenjie Fu"
git config --global user.email "[email protected]"
git branch
ls
# Create a new orphan branch with the latest commit
git checkout --orphan latest_commit
# Add all files to the new branch
git add -A
# Commit the changes
git commit -m "Final Commit"
# Force push to update the repository
git push -f origin main

0 comments on commit cf03eb2

Please sign in to comment.