# ⚠️ WARNING: THIS WORKFLOW FORCE-PUSHES REWRITTEN GIT HISTORY. # IT PERMANENTLY REMOVES FILE PATHS FROM ALL COMMITS ACROSS THE REPOSITORY. # USE WITH EXTREME CAUTION AND ONLY WHEN PURGING ACCIDENTALLY COMMITTED BINARIES. name: Purge Binaries from Git History on: workflow_dispatch: inputs: confirm: description: "Type PURGE to confirm force rewriting repository history" required: true default: "" permissions: contents: write jobs: purge: runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: - name: Validate Confirmation Input env: CONFIRM: ${{ inputs.confirm }} run: | if [ "$CONFIRM" != "PURGE" ]; then echo "Error: Confirmation input must be exactly 'PURGE'" >&2 exit 1 fi - name: Checkout Full History uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install git-filter-repo run: | sudo apt-get update sudo apt-get install -y git-filter-repo - name: Configure Git run: | git config user.name "GitHub Action Bot" git config user.email "action@github.com" - name: Rewrite History (Delete OS folders completely) run: | git filter-repo --invert-paths \ --path android \ --path linux \ --path macos \ --path windows \ --force