Skip to content

Commit bb2b686

Browse files
committed
Preserve github workflows
1 parent 89125f2 commit bb2b686

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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: # 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+

0 commit comments

Comments
 (0)