Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions .github/workflows/shared-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ jobs:
path: cs-coverage
merge-multiple: true

- name: Setup Git for Push
shell: bash
env:
BADGE_BRANCH: ${{ inputs.badge_branch || github.ref_name }}
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git remote set-branches origin '*'
git fetch origin "$BADGE_BRANCH"
git branch --set-upstream-to="origin/$BADGE_BRANCH" "$BADGE_BRANCH" || true

- name: Generate Coverage Report
shell: pwsh
run: |
Expand Down
5 changes: 4 additions & 1 deletion scripts/coverage_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ def git_commit_badges(badge_branch: str, ref_name: str) -> None:
diff = run(["git", "diff", "--staged", "--quiet"])
if diff.returncode != 0:
run(["git", "commit", "-m", "ci: update coverage badges"])
run(["git", "push", "origin", f"HEAD:{target}"])
result = run(["git", "push", "origin", f"HEAD:{target}"])
if result.returncode != 0:
print(f"ERROR: git push failed:\n{result.stderr}", flush=True)
raise SystemExit(1)
print(f"Committed and pushed badge updates to {target}")
else:
print("No badge changes to commit")
Expand Down
Loading