add FilenCloud.Filen-cli #32
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 Package Count Badge | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/github-releases.yml | |
- .github/workflows/update-via-script.yml | |
jobs: | |
update-package-count: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: pip install pyyaml | |
- name: Count packages | |
id: count | |
run: | | |
echo "countgithub=$(python3 scripts/package_count.py .github/workflows/github-releases.yml)" >> $GITHUB_OUTPUT | |
echo "countscript=$(python3 scripts/package_count.py .github/workflows/update-via-script.yml)" >> $GITHUB_OUTPUT | |
- name: Update README | |
run: | | |
countgithub=${{ steps.count.outputs.countgithub }} | |
countscript=${{ steps.count.outputs.countscript }} | |
sed -i "s/ScriptPackages-[0-9]*-green/ScriptPackages-$countscript-green/g" README.md | |
sed -i "s/GithubPackages-[0-9]*-blue/GithubPackages-$countgithub-blue/g" README.md | |
- name: Commit and push | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Update package count badge | |
file_pattern: README.md |