mirror of
https://github.com/emmabostian/developer-portfolios.git
synced 2025-01-23 01:46:00 +00:00
Add commit step to actions
This commit is contained in:
parent
6ebe8c73ae
commit
49c42fbaac
9
.github/workflows/update-banner.yml
vendored
9
.github/workflows/update-banner.yml
vendored
@ -19,3 +19,12 @@ jobs:
|
||||
|
||||
- name: Count list items and update README
|
||||
run: python3 src/update_banner.py
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add README.md
|
||||
git commit -m "Update list count in README" -a || echo "No changes to commit"
|
||||
git push
|
||||
|
||||
|
@ -9,7 +9,7 @@ This repo was inspired by [Ali Spittel's](https://twitter.com/ASpittel) tweet
|
||||
|
||||
Hopefully this repo can serve as a source of inspiration for your portfolio!
|
||||
|
||||
## Current List Count: 4
|
||||
## Current List Count: 613
|
||||
|
||||
---
|
||||
|
||||
|
@ -12,12 +12,15 @@ with open(readme_path, 'r', encoding='utf-8') as file:
|
||||
|
||||
# Count the list items
|
||||
list_count = len(re.findall(r'^\s*-\s', readme_contents, re.MULTILINE))
|
||||
print(list_count)
|
||||
|
||||
# Define the new banner message
|
||||
new_banner = f'## Current List Count: {list_count}'
|
||||
print(new_banner)
|
||||
|
||||
# Replace old banner with new banner in README
|
||||
new_readme_contents = re.sub(r'## Current List Count: \d+', new_banner, readme_contents)
|
||||
print(new_readme_contents)
|
||||
|
||||
# Save the changes back to README.md
|
||||
with open(readme_path, 'w', encoding='utf-8') as file:
|
||||
|
Loading…
Reference in New Issue
Block a user