-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #906 from Ana06/num_packages
[CI] Update packages number badge in README
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Updates packages number badge on README | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
update_badge: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Update packages number badge in README | ||
run: | | ||
# Counts all packages in /packages including installer.vm | ||
num_packages=$(ls packages | wc -l) | ||
sed -i "s/badge\/packages-[0-9]*-blue\.svg/badge\/packages-$num_packages-blue.svg/" README.md | ||
- name: Commit changes | ||
run: | | ||
git config user.email '[email protected]' | ||
git config user.name 'vm-packages' | ||
# Do not fail the action if packages number doesn't change | ||
git add -A | ||
git diff-index --quiet HEAD || git commit -am '[README] Update package number badge' | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master |
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