Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/coverage-badges.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
name: Update Coverage Badges

on:
push:
branches: [ main ]
workflow_run:
workflows: ["Production Release"]
types: [completed]
branches: [main]
workflow_dispatch:

concurrency:
group: coverage-badges-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
update-badges:
name: Update Coverage Badges
runs-on: ubuntu-latest
# Skip if commit message contains [skip ci]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
# Run on workflow_dispatch or when Production Release succeeds (skip if commit has [skip ci])
if: >
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
!contains(github.event.workflow_run.head_commit.message, '[skip ci]'))

steps:
- name: Checkout code
Expand Down Expand Up @@ -131,6 +140,8 @@ jobs:
if [[ -n $(git status --porcelain) ]]; then
git add README.md .github/badges/
git commit -m "chore: update coverage badges [skip ci]"
# Pull latest changes before pushing to handle any commits made during workflow run
git pull --rebase origin main
git push
else
echo "No changes to coverage badges"
Expand Down