Remove non-SVG files #3
This file contains 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: Remove non-SVG files | |
on: | |
workflow_run: | |
workflows: ["traffic2badge"] | |
types: | |
- completed | |
jobs: | |
cleanup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout traffic branch | |
uses: actions/checkout@v3 | |
with: | |
ref: traffic | |
fetch-depth: 0 # Ensure the entire history is fetched | |
- name: Set up Git user | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Remove non-SVG files | |
run: | | |
find . -type f ! -name '*.svg' -delete | |
- name: Commit changes | |
run: | | |
git add . | |
git commit -m "Remove all files except .svg files" || echo "No changes to commit" | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.TRAFFIC_TOKEN }} | |
branch: traffic |