Spaces:
Running
Running
Download .github/workflows/clean_repo_again.example from Alibrown/BulkScam-CPU: direct link, hf CLI and curl.
- Browser
- Download file 2.09 kB
-
https://huggingface.co/spaces/Alibrown/BulkScam-CPU/resolve/main/.github/workflows/clean_repo_again.example
- Command line
-
hf download hf://spaces/Alibrown/BulkScam-CPU/.github/workflows/clean_repo_again.example
-
curl -L -o clean_repo_again.example https://huggingface.co/spaces/Alibrown/BulkScam-CPU/resolve/main/.github/workflows/clean_repo_again.example
2.09 kB
| name: Clean Slate (Custom Keep List) | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| wipe-repo: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Rebuild Clean Branch with Whitelist | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # 1. Create an orphan branch with no history | |
| git checkout --orphan temp-clean-slate | |
| # 2. Empty the Git index (files on disk stay untouched) | |
| git read-tree --empty | |
| # ================================================================= | |
| # WHITELIST: Define what should be preserved. | |
| # Comment out unused lines with '#'! | |
| # ================================================================= | |
| # Core / Infrastructure | |
| [ -e .github ] && git add .github/ | |
| [ -e README.md ] && git add README.md | |
| [ -e .gitignore ] && git add .gitignore | |
| [ -e .gitattributes ] && git add .gitattributes | |
| # Documentation & Legal | |
| [ -e LICENSE ] && git add LICENSE | |
| [ -e SECURITY.md ] && git add SECURITY.md | |
| [ -e STATUS.md ] && git add STATUS.md | |
| [ -e CONTRIBUTING.md ] && git add CONTRIBUTING.md | |
| [ -e CODE_OF_CONDUCT.md ] && git add CODE_OF_CONDUCT.md | |
| [ -e CITATION.cff ] && git add CITATION.cff | |
| # Custom Additions | |
| # [ -e .pyfun ] && git add .pyfun | |
| # ================================================================= | |
| # 3. Create a clean commit | |
| git commit -m "style: reset repository keeping whitelisted core metadata" | |
| # 4. Replace the local main branch with the clean branch | |
| git branch -D main | |
| git branch -m main | |
| - name: Force Push to Main | |
| run: | | |
| git push origin main --force | |