Skip to content

Commit e24a3cc

Browse files
authored
feat: cache VS Code Marketplace version badge via Gist (#88)
Replace the unreliable vsmarketplacebadges.dev badge with a shields.io endpoint badge that reads from a GitHub Gist JSON file. The release workflow now writes the version to the same Gist used for coverage, so the badge never hits a flaky third-party service. - Add version extraction and dynamic-badges-action step to release.yml - Update README badge URL to use Gist endpoint - Remove vsmarketplacebadges.dev from lychee exclude list - Seed Gist with initial version.json for v0.0.1 Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent 73c7231 commit e24a3cc

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,20 @@ jobs:
7474
- name: Publish to Open VSX
7575
if: env.OVSX_PAT != ''
7676
run: npx ovsx publish patchloom.vsix
77+
- name: Extract version from tag
78+
id: version
79+
run: echo "version=${TAG_NAME#patchloom-}" >> "$GITHUB_OUTPUT"
80+
env:
81+
TAG_NAME: ${{ needs.release-please.outputs.tag_name }}
82+
- name: Update version badge
83+
continue-on-error: true
84+
uses: schneegans/dynamic-badges-action@0e50b8bad39e7e1afd3e4e9c2b7dd145fad07501 # v1.8.0
85+
with:
86+
auth: ${{ secrets.GIST_TOKEN }}
87+
gistID: d01e4551b744b77e2927555e43a4b935
88+
filename: version.json
89+
label: VS Code Marketplace
90+
message: ${{ steps.version.outputs.version }}
91+
color: blue
92+
namedLogo: visualstudiocode
93+
logoColor: white

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![CI](https://github.com/patchloom/patchloom-vscode/actions/workflows/ci.yml/badge.svg)](https://github.com/patchloom/patchloom-vscode/actions/workflows/ci.yml)
88
[![Security](https://github.com/patchloom/patchloom-vscode/actions/workflows/security.yml/badge.svg)](https://github.com/patchloom/patchloom-vscode/actions/workflows/security.yml)
99
[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SebTardif/d01e4551b744b77e2927555e43a4b935/raw/coverage.json)](https://github.com/patchloom/patchloom-vscode/actions/workflows/ci.yml)
10-
[![VS Code Marketplace](https://vsmarketplacebadges.dev/version/patchloom.patchloom.svg)](https://marketplace.visualstudio.com/items?itemName=patchloom.patchloom)
10+
[![VS Code Marketplace](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SebTardif/d01e4551b744b77e2927555e43a4b935/raw/version.json)](https://marketplace.visualstudio.com/items?itemName=patchloom.patchloom)
1111
[![Open VSX](https://img.shields.io/open-vsx/v/patchloom/patchloom)](https://open-vsx.org/extension/patchloom/patchloom)
1212
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/patchloom/patchloom-vscode/badge)](https://securityscorecards.dev/viewer/?uri=github.com/patchloom/patchloom-vscode)
1313
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/13100/badge)](https://www.bestpractices.dev/projects/13100)

lychee.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ exclude = [
1616
"https://marketplace.visualstudio.com/items\\?itemName=patchloom\\.patchloom",
1717
"https://open-vsx.org/extension/patchloom/patchloom",
1818
"https://github.com/patchloom/patchloom-vscode/compare/patchloom-v",
19-
# Badge SVG endpoints are unreliable for link checking (transient 500s)
20-
"https://vsmarketplacebadges\\.dev/",
2119
]

0 commit comments

Comments
 (0)