Skip to content

init ticket system

init ticket system #57

Workflow file for this run

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