Files
atomic-red-team/.github/workflows/generate-counter.yml
T
dependabot[bot] 61733d1e90 Bump actions/checkout from 3 to 4 (#2705)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 09:07:37 -06:00

40 lines
1.3 KiB
YAML

name: generate-svg-counter
on:
push:
branches: ["master"]
jobs:
generate-counter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PROTECTED_BRANCH_PUSH_TOKEN }}
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.11.2'
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Generate shields.io URL
run: poetry run python bin/generate_counter.py -f atomics/
id: counter
- name: Update README
run: |
echo ${{ steps.counter.outputs.result }}
sed -i "s|https://img.shields.io/badge/Atomics-.*-flat.svg|${{ steps.counter.outputs.result }}|" README.md
shell: bash
- name: update github with new site
run: |
# configure git to prep for commit
git config user.email "opensource@redcanary.com"
git config user.name "publish bot"
git config --global push.default simple
git add README.md
git commit --allow-empty -m "updating atomics count in README.md [ci skip]"
# push quietly to prevent showing the token in log
# no need to provide any credentials
git push --force