Create remove-txt.yml #1
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 .txt from file names | |
on: | |
push: | |
branches: | |
- main # Trigger this workflow on push to the main branch | |
jobs: | |
rename: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Rename .txt files | |
run: | | |
for file in $(find . -type f -name "*.txt"); do | |
mv "$file" "${file%.txt}" | |
done | |
- name: Push changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Remove .txt from file names" && git push || echo "No changes to commit" |