-
Notifications
You must be signed in to change notification settings - Fork 41
✨ Auto-update coverage badge via gist on merge to main #4066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,13 +7,19 @@ on: | |||||
| - 'web/src/**' | ||||||
| - 'web/vite.config.ts' | ||||||
| - 'web/package.json' | ||||||
| push: | ||||||
| branches: [main] | ||||||
| paths: | ||||||
| - 'web/src/**' | ||||||
| - 'web/vite.config.ts' | ||||||
| - 'web/package.json' | ||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
| pull-requests: write | ||||||
|
|
||||||
| concurrency: | ||||||
| group: coverage-gate-${{ github.event.pull_request.number }} | ||||||
| group: coverage-gate-${{ github.event.pull_request.number || github.sha }} | ||||||
| cancel-in-progress: true | ||||||
|
|
||||||
| env: | ||||||
|
|
@@ -152,7 +158,7 @@ jobs: | |||||
| retention-days: 14 | ||||||
|
|
||||||
| - name: Comment on PR | ||||||
| if: steps.gate.outputs.status != 'skip' | ||||||
| if: github.event_name == 'pull_request' && steps.gate.outputs.status != 'skip' | ||||||
| uses: actions/github-script@v7 | ||||||
| with: | ||||||
| script: | | ||||||
|
|
@@ -192,3 +198,53 @@ jobs: | |||||
| body: fullBody, | ||||||
| }); | ||||||
| } | ||||||
|
|
||||||
| # Update coverage badge gist on push to main | ||||||
| - name: Update coverage badge | ||||||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||||||
| uses: actions/github-script@v7 | ||||||
| env: | ||||||
| GIST_ID: 'b9a9ae8469f1897a22d5a40629bc1e82' | ||||||
| with: | ||||||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
||||||
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| github-token: ${{ secrets.COVERAGE_GIST_TOKEN }} |
Copilot
AI
Apr 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The badge color logic doesn’t match the PR description: this code produces brightgreen (>=60), yellow (40–59), and orange (<40), and the initial red value is never used. Either align the thresholds/colors with the documented scheme (red <40, orange 40–59, green 60+), or update the PR description to reflect the actual colors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concurrency group uses
github.shaforpushruns, which makes every run a unique group and effectively disablescancel-in-progresson repeated pushes tomain(older runs won't be cancelled). Consider grouping push runs by branch/ref (e.g.,github.ref) so only the latestmainrun proceeds and you avoid overlapping Vitest runs / gist updates.