Skip to content

Commit ca38c91

Browse files
authored
[#258] Cleanup CI and Test Badge Creation
1 parent ec631f8 commit ca38c91

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/mc_dc_coverage.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Fetch full history
1921

2022
# Install dependencies and setup environment
2123
- name: Install Dependencies
@@ -61,6 +63,11 @@ jobs:
6163
curl -o coverage/line-coverage-badge.svg "https://img.shields.io/badge/line%20coverage-${LINE_COVERAGE_PERCENT}%25-brightgreen"
6264
curl -o coverage/branch-coverage-badge.svg "https://img.shields.io/badge/branch%20coverage-${BRANCH_COVERAGE_PERCENT}%25-brightgreen"
6365
66+
# Fix detached HEAD state
67+
- name: Fix Detached HEAD
68+
run: git checkout -B ${GITHUB_REF##*/}
69+
working-directory: ${{ github.workspace }}
70+
6471
# Commit badges to a separate branch
6572
- name: Commit Coverage Badges
6673
if: ${{ github.event_name == 'push' }}
@@ -72,6 +79,7 @@ jobs:
7279
git add coverage/branch-coverage-badge.svg
7380
git commit -m "Update coverage badges"
7481
git push origin badges
82+
working-directory: ${{ github.workspace }}
7583

7684
# Upload consolidated coverage report as an artifact
7785
- name: Upload Coverage Report

0 commit comments

Comments
 (0)