Delete config (copy).json #68
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: Update Lines of Code Badge | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
update-badge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Count lines of code | |
id: count_lines | |
run: | | |
lines=$(find . -name '*.py' -or -name '*.js' -or -name '*.java' -or -name '*.cpp' -or -name '*.c' -or -name '*.go' -or -name '*.rb' | xargs wc -l | tail -n 1 | awk '{print $1}') | |
echo "lines=$lines" >> $GITHUB_ENV | |
- name: Update README.md | |
run: | | |
badge="![Lines of Code](https://img.shields.io/badge/lines%20of%20code-${{ env.lines }}-blue)" | |
sed -i "s|!\[Lines of Code\].*|$badge|" README.md | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add README.md | |
git commit -m "Update lines of code badge" || echo "No changes to commit" | |
git push |