Skip to content

Commit a66d4bd

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

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)