File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Force Reset While Preserving .github
2+
3+ on :
4+ workflow_dispatch : # You can trigger this manually
5+
6+ jobs :
7+ reset-job :
8+ runs-on : ubuntu-latest
9+
10+ steps :
11+ - name : Checkout repository
12+ uses : actions/checkout@v4
13+ with :
14+ fetch-depth : 0 # Needed for full history and reset
15+
16+ - name : Backup .github directory
17+ run : |
18+ echo "Backing up .github directory..."
19+ cp -r .github /tmp/github-backup
20+
21+ - name : Force reset to origin/main
22+ run : |
23+ echo "Resetting to origin/main..."
24+ git fetch origin
25+ git reset --hard origin/main
26+
27+ - name : Restore .github directory
28+ run : |
29+ echo "Restoring .github directory..."
30+ cp -r /tmp/github-backup/. .github/
31+
32+ - name : Show final status
33+ run : |
34+ echo "Final git status:"
35+ git status
36+
You can’t perform that action at this time.
0 commit comments