Extract ZIP Archives #2
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: Extract ZIP Archives | |
| on: | |
| push: | |
| branches: [main, master] | |
| paths: | |
| - '**.zip' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| extract: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract ZIP files to root and delete | |
| run: | | |
| find . -name "*.zip" -type f -not -path "./.git/*" | while read -r zipfile; do | |
| echo "Extracting: $zipfile" | |
| unzip -o "$zipfile" -d . | |
| rm "$zipfile" | |
| echo "Deleted: $zipfile" | |
| done | |
| - name: Commit and push | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| if ! git diff --cached --quiet; then | |
| git commit -m "chore: extract zip archives [skip ci]" | |
| git push | |
| fi |