Skip to content

Commit

Permalink
Merge pull request #906 from Ana06/num_packages
Browse files Browse the repository at this point in the history
[CI] Update packages number badge in README
  • Loading branch information
Ana06 authored Feb 20, 2024
2 parents 2b5d0b1 + fd40fb3 commit 334d58f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/sync_badge.yml
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Packages](https://img.shields.io/badge/packages->100-blue.svg)](packages)
[![Packages](https://img.shields.io/badge/packages-212-blue.svg)](packages)
[![CI](https://github.com/mandiant/VM-packages/workflows/CI/badge.svg)](https://github.com/mandiant/VM-packages/actions?query=workflow%3ACI+branch%3Amain)
[![Daily run](https://github.com/mandiant/VM-packages/workflows/daily/badge.svg)](https://github.com/mandiant/VM-Packages/wiki/Daily-Failures)

Expand Down

0 comments on commit 334d58f

Please sign in to comment.