Skip to content
Open
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
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ updates:
default-days: 3
labels:
- "dependencies"
ignore:
# v2.6.0's image cannot be pulled from ghcr.io; see scorecard.yml.
- dependency-name: "ossf/scorecard-action"
versions: ["2.6.0"]
groups:
github-actions:
patterns:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
name: CodeQL

# Pull requests that change only docs/ or Markdown skip the scan; the Go and
# JavaScript examples under docs/ stay in (later patterns win). Pushes to main
# are never filtered: code scanning compares a pull request with the analysis
# of its base commit, and a skipped push leaves that commit without one.
on:
push:
branches: [main]
pull_request:
branches: [main]
paths:
- "**"
- "!docs/**"
- "docs/example_plugins/**"
- "docs/examples/**"
- "!**/*.md"
- "!**/*.mdx"
schedule:
- cron: "31 3 * * 1"

Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docs

on:
push:
branches: [main]
paths:
- "docs/**"
- ".github/workflows/docs.yml"
pull_request:
branches: [main]
paths:
- "docs/**"
- ".github/workflows/docs.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
docs-validate:
name: Docs Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

# To avoid possible issues related to missing libsecret binary on the runner
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev

- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: '22'

# Pinned: a bare `npx mint` installs the release published last, and a
# mint release reaches npm a few minutes before the @mintlify/cli version
# it depends on, so a run in that window fails with ETARGET. Dependabot
# does not see this pin; bump it by hand.
- name: Validate docs.json
run: npx mint@4.3.37 validate
working-directory: docs
4 changes: 3 additions & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
persist-credentials: false

- name: Run analysis
uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0
# v2.6.0's image index points at an amd64 manifest missing from ghcr.io,
# so the pull fails; stay on v2.5.0 until a fixed release ships.
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
with:
results_file: results.sarif
results_format: sarif
Expand Down
100 changes: 54 additions & 46 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
name: CI

# Changes that touch only docs/, helm/ or Markdown files skip this workflow.
# docs.yml validates docs/ and helm.yml the chart; other Markdown has no check.
# docs/example_plugins stays in: it is Go code the e2e suite builds and loads.
# Later patterns win, so the order matters.
on:
push:
branches: [main]
paths:
- "**"
- "!docs/**"
- "docs/example_plugins/**"
- "!helm/**"
- "!**/*.md"
pull_request:
branches: [main]
paths:
- "**"
- "!docs/**"
- "docs/example_plugins/**"
- "!helm/**"
- "!**/*.md"

# Cancel redundant runs on the same branch
concurrency:
Expand All @@ -25,6 +41,39 @@ permissions:
contents: read

jobs:
# A pull request that changes only Go tests (*_test.go, tests/, testdata/)
# leaves the binary and its dependency graph untouched, so it skips the
# Dashboard, Build and Vulnerability Scan jobs. Pushes to main run them all.
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
source: ${{ steps.diff.outputs.source }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
# The pull request merge commit's first parent is the base branch,
# so a depth of 2 is enough to diff against it.
fetch-depth: 2

- name: Check for non-test changes
id: diff
run: |
if [ "${{ github.event_name }}" != "pull_request" ]; then
echo "source=true" >> "$GITHUB_OUTPUT"
exit 0
fi
# --no-renames lists both sides of a rename, so moving a source file
# into a test path still counts as a source change.
changed=$(git diff --name-only --no-renames HEAD^1 HEAD)
if grep -qvE '(_test\.go$|^tests/|(^|/)testdata/)' <<< "$changed"; then
echo "source=true" >> "$GITHUB_OUTPUT"
else
echo "source=false" >> "$GITHUB_OUTPUT"
echo "Only Go test files changed; skipping Dashboard, Build and Vulnerability Scan."
fi

lint:
name: lint
runs-on: ubuntu-latest
Expand Down Expand Up @@ -70,6 +119,8 @@ jobs:
# sources and package-lock.json only. See docs/adr/0010-dashboard-built-in-ci.md.
frontend:
name: Dashboard
needs: changes
if: needs.changes.outputs.source == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
Expand Down Expand Up @@ -263,6 +314,8 @@ jobs:

vulncheck:
name: Vulnerability Scan
needs: changes
if: needs.changes.outputs.source == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -287,58 +340,13 @@ jobs:
govulncheck ./...
govulncheck -tags=swagger ./...

# Only runs when the pull request touches docs/. Pushes to main always run
# it. The check needs a full Node toolchain (libsecret, mint) that costs
# more than the validation itself.
docs-validate:
name: Docs Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
# The pull request merge commit's first parent is the base branch,
# so a depth of 2 is enough to diff against it.
fetch-depth: 2

- name: Check for docs changes
id: changes
run: |
if [ "${{ github.event_name }}" != "pull_request" ]; then
echo "docs=true" >> "$GITHUB_OUTPUT"
elif git diff --name-only HEAD^1 HEAD -- docs/ | grep -q .; then
echo "docs=true" >> "$GITHUB_OUTPUT"
else
echo "docs=false" >> "$GITHUB_OUTPUT"
echo "No docs/ changes; skipping validation."
fi

# To avoid possible issues related to missing libsecret binary on the runner runner
- name: Install system dependencies
if: steps.changes.outputs.docs == 'true'
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev

- name: Setup Node.js
if: steps.changes.outputs.docs == 'true'
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: '22'

# Pinned: a bare `npx mint` installs the release published last, and a
# mint release reaches npm a few minutes before the @mintlify/cli version
# it depends on, so a run in that window fails with ETARGET. Dependabot
# does not see this pin; bump it by hand.
- name: Validate docs.json
if: steps.changes.outputs.docs == 'true'
run: npx mint@4.3.37 validate
working-directory: docs

# Compiling the binary doesn't depend on tests passing, so this runs in
# parallel with the test jobs rather than gating behind them. It is the one
# Go job that embeds the real dashboard bundle.
build:
name: Build
runs-on: ubuntu-latest
# Skipped with the Dashboard job when only Go tests changed.
needs: frontend
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
Expand Down
Loading