Delete lazy-lock.json #15
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 README with metrics | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Set up Git | |
run: | | |
# Configure Git user information | |
git config --global user.email "[email protected]" | |
git config --global user.name "[BOT] Update Readme" | |
- name: Generate metrics | |
run: python3 metrics.py > metrics.txt | |
- name: Update README | |
run: | | |
# Read metrics from file | |
config_files=$(sed -n '1p' metrics.txt) | |
lines_of_code=$(sed -n '2p' metrics.txt) | |
# Search for the lines containing "Config files:" and "Lines of code:" in the README file | |
# If found, replace the existing metrics with the new ones | |
sed -i "s/Config files:.*/Config files: $config_files/" README.md | |
sed -i "s/Lines of code:.*/Lines of code: $lines_of_code/" README.md | |
- name: Commit changes | |
run: | | |
# Add the updated README file to the commit | |
git add README.md | |
# Commit the changes | |
git commit -m "Update README with metrics" || true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.ACESS_TOKEN }} | |