🧹 Clear Download Folder #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🧹 Clear Download Folder | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| warning: | |
| description: '⚠️ WARNING: This will DELETE ALL files inside downloads/ folder. Click "Run workflow" only if you are sure.' | |
| required: false | |
| default: 'Read this warning before proceeding' | |
| jobs: | |
| delete: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Remove downloads folder and recreate it | |
| run: | | |
| rm -rf downloads | |
| mkdir downloads | |
| - name: Commit and push empty folder | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git add downloads | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "[AVASAM] Empty downloads folder [skip ci]" | |
| git pull --rebase origin "${{ github.ref_name }}" | |
| git push origin HEAD:"${{ github.ref_name }}" | |
| echo "✅ downloads folder cleared" | |
| fi |