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
37 changes: 36 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,42 @@ jobs:

- name: Check code coverage
if: matrix.os == 'ubuntu-latest'
run: npm run test:coverage
id: coverage
run: |
output=$(npm run test:coverage 2>&1)
echo "$output"
pct=$(echo "$output" | grep 'all files' | head -1 | awk -F'|' '{gsub(/[[:space:]]/, "", $2); print $2}')
echo "percentage=$pct" >> "$GITHUB_OUTPUT"

- name: Determine badge color
if: matrix.os == 'ubuntu-latest'
id: color
run: |
pct="${{ steps.coverage.outputs.percentage }}"
int_pct=${pct%.*}
if [ "$int_pct" -ge 90 ]; then
echo "color=brightgreen" >> "$GITHUB_OUTPUT"
elif [ "$int_pct" -ge 80 ]; then
echo "color=green" >> "$GITHUB_OUTPUT"
elif [ "$int_pct" -ge 70 ]; then
echo "color=yellowgreen" >> "$GITHUB_OUTPUT"
elif [ "$int_pct" -ge 60 ]; then
echo "color=yellow" >> "$GITHUB_OUTPUT"
else
echo "color=red" >> "$GITHUB_OUTPUT"
fi

- name: Update coverage badge
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' && github.ref == 'refs/heads/main'
continue-on-error: true
uses: schneegans/dynamic-badges-action@0e50b8bad39e7e1afd3e4e9c2b7dd145fad07501 # v1.8.0
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: d01e4551b744b77e2927555e43a4b935
filename: coverage.json
label: coverage
message: ${{ steps.coverage.outputs.percentage }}%
color: ${{ steps.color.outputs.color }}

build:
runs-on: ubuntu-latest
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
if: github.event.pull_request.merged == true
permissions:
actions: write
contents: write
steps:
- name: Harden runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
Expand All @@ -32,3 +33,13 @@ jobs:
gh workflow run ci.yml --ref main --repo "${{ github.repository }}"
gh workflow run security.yml --ref main --repo "${{ github.repository }}"
gh workflow run scorecard.yml --ref main --repo "${{ github.repository }}"

- name: Auto-update open PR branches
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr list --base main --state open --json number --jq '.[].number' \
--repo "${{ github.repository }}" | while read -r pr; do
echo "Updating PR #$pr"
gh pr update-branch "$pr" --repo "${{ github.repository }}" || true
done
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

[![CI](https://github.com/patchloom/patchloom-vscode/actions/workflows/ci.yml/badge.svg)](https://github.com/patchloom/patchloom-vscode/actions/workflows/ci.yml)
[![Security](https://github.com/patchloom/patchloom-vscode/actions/workflows/security.yml/badge.svg)](https://github.com/patchloom/patchloom-vscode/actions/workflows/security.yml)
[![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)
[![VS Code Marketplace](https://vsmarketplacebadges.dev/version/patchloom.patchloom.svg)](https://marketplace.visualstudio.com/items?itemName=patchloom.patchloom)
[![Open VSX](https://img.shields.io/open-vsx/v/patchloom/patchloom)](https://open-vsx.org/extension/patchloom/patchloom)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/patchloom/patchloom-vscode/badge)](https://securityscorecards.dev/viewer/?uri=github.com/patchloom/patchloom-vscode)
Expand Down
2 changes: 2 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ exclude = [
"https://marketplace.visualstudio.com/items\\?itemName=patchloom\\.patchloom",
"https://open-vsx.org/extension/patchloom/patchloom",
"https://github.com/patchloom/patchloom-vscode/compare/patchloom-v",
# Badge SVG endpoints are unreliable for link checking (transient 500s)
"https://vsmarketplacebadges\\.dev/",
]
Loading