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
15 changes: 15 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
#
# Shared CodeRabbit settings for every application made from application-template.
# The template owns this file and template-sync keeps it current, so a change here
# reaches every application. `inheritance: true` layers it over the organization's
# CodeRabbit settings. To diverge, list `.coderabbit.yaml` in your
# `.templatesyncignore` and own your copy.
inheritance: true
reviews:
# A review finding is a comment to fix or refute, not a failed status check:
# CI - Required Checks is the merge gate.
fail_commit_status: false
pre_merge_checks:
docstrings:
mode: warning
16 changes: 16 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# What CodeQL analyses in this application. This file is yours: template-sync never
# overwrites it, while .github/workflows/codeql.yaml, which reads it, stays shared.
# Reference: https://docs.github.com/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning
name: CodeQL configuration

# security-extended adds lower-precision security queries to the default suite.
queries:
- uses: security-extended

# Generated and vendored output is not your code.
paths-ignore:
- "**/node_modules"
- "**/.svelte-kit"
- "**/build"
- "**/bin"
- "**/obj"
63 changes: 63 additions & 0 deletions .github/mega-linter.base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Shared MegaLinter settings for every application made from application-template.
# The template owns this file and template-sync keeps it current. Your own settings
# go in .mega-linter.yml, which extends this file and wins wherever they differ.
#
# MegaLinter checks what every repository shares: workflows, shell scripts,
# Dockerfiles, Markdown, YAML and JSON, Kubernetes manifests, and leaked secrets.
# Each stack's own CI lints its language (golangci-lint, ESLint and svelte-check,
# the .NET analyzers), so MegaLinter does not lint those again.
FLAVOR_SUGGESTIONS: false
IGNORE_GITIGNORED_FILES: true
SHOW_ELAPSED_TIME: true
# Linter configuration files (.markdownlint.json, .yamllint.yml, ...) live at the root.
LINTER_RULES_PATH: .
# Generated lockfiles are not hand-written and are not linted.
FILTER_REGEX_EXCLUDE: (package-lock\.json|go\.sum)
EXCLUDED_DIRECTORIES:
- .git
- megalinter-reports
- node_modules
- .svelte-kit
- build
- bin
- obj
DISABLE:
# Languages the stack's CI owns.
- GO
- JAVASCRIPT
- TYPESCRIPT
- TSX
- JSX
# Spelling and copy-paste detection are opt-in: add them back in .mega-linter.yml.
- COPYPASTE
- SPELL
DISABLE_LINTERS:
# The organization's required zizmor and dependency-review workflows cover these.
- ACTION_ZIZMOR
- REPOSITORY_GRYPE
- REPOSITORY_OSV_SCANNER
# Scripts run through `sh`, so they need no executable bit; their formatting is the
# owner's choice, and shellcheck still checks that they are correct.
- BASH_EXEC
- BASH_SHFMT
# Reformats tables only; markdownlint checks the Markdown itself.
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
# deploy/ follows the platform's conventions (namespace set at reconcile time, UID 1000,
# no CPU limit, the image digest pinned at release), which the platform's own admission
# policies enforce. These generic policy scanners contradict them on every manifest.
- REPOSITORY_CHECKOV
- KUBERNETES_KUBESCAPE
# A Jinja/Django template linter; plain HTML is checked by htmlhint.
- HTML_DJLINT
# Kubernetes manifests use custom resources (CloudNativePG, External Secrets, Gateway
# API) whose schemas are not bundled; core kinds are still checked.
KUBERNETES_KUBECONFORM_ARGUMENTS: -ignore-missing-schemas
# Block on high and critical findings only.
REPOSITORY_TRIVY_ARGUMENTS:
- --severity
- HIGH,CRITICAL
# SvelteKit's page shell holds %sveltekit.*% placeholders, not finished HTML.
HTML_FILTER_REGEX_EXCLUDE: (src/app\.html)
# CodeQL configuration has no published JSON schema, and Kubernetes manifests are
# validated by kubeconform (v8r would match them to unrelated schemas by file name).
YAML_V8R_FILTER_REGEX_EXCLUDE: (\.github/codeql/|deploy/)
5 changes: 3 additions & 2 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ jobs:
publish:
name: Publish
# Skipped in the template repo itself (it ships no app); runs in every tenant
# created from this template.
if: github.repository != 'devantler-tech/platform-tenant-template'
# created from this template. The template is matched by its repository ID,
# which survives the rename from platform-tenant-template to application-template.
if: github.repository_id != '1253884448'
permissions:
contents: read # checkout
packages: write # push image + manifests OCI artifact
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,21 @@ jobs:
- name: 🏷️ Validate which dependency updates release
run: sh scripts/release-classification.test.sh

# The template's shared MegaLinter checks for workflows, scripts, the Dockerfile, Markdown, YAML,
# JSON, Kubernetes manifests and leaked secrets; ESLint and svelte-check above lint the app's own
# code. Configure it in .mega-linter.yml, which extends the template's base.
megalinter:
name: MegaLinter
# GitHub's `$/` self-repository form fails actionlint until it supports it
# (rhysd/actionlint#711); switch then.
uses: ./.github/workflows/lint.yaml # zizmor: ignore[self-repository]
permissions:
contents: read

ci-required-checks:
name: CI - Required Checks
runs-on: ubuntu-latest
needs: [lint, check, test, e2e, build, boot-smoke, workflow-caller-pins, readonly-rootfs, publish-pin-approved, validate-retired-links, node-toolchain, release-classification]
needs: [lint, check, test, e2e, build, boot-smoke, workflow-caller-pins, readonly-rootfs, publish-pin-approved, validate-retired-links, node-toolchain, release-classification, megalinter]
permissions:
actions: read
if: ${{ always() }}
Expand All @@ -345,3 +356,4 @@ jobs:
${{ needs.validate-retired-links.result }}
${{ needs.node-toolchain.result }}
${{ needs.release-classification.result }}
${{ needs.megalinter.result }}
123 changes: 123 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: 🔍 CodeQL

# Advanced CodeQL setup for every application. The template owns this workflow and
# template-sync keeps it current; tune what it analyses in your own
# `.github/codeql/codeql-config.yml` (queries, paths, query filters).
#
# GitHub refuses advanced results while the repository's CodeQL default setup is on,
# so this stays off until both switches are made, in this order:
# 1. turn default setup off (Settings → Code security → CodeQL analysis), then
# 2. set the repository variable CODEQL_SETUP to `advanced`.
# The languages come from the repository's own files, so a new stack needs no edit here.
# Fix its alerts in ordinary reviewed pull requests, never with Copilot Autofix.
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "27 5 * * 1" # weekly, Monday 05:27 UTC
workflow_dispatch:

permissions: {}

concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
languages:
name: Detect languages
if: vars.CODEQL_SETUP == 'advanced'
runs-on: ubuntu-latest
permissions:
contents: read # checkout only
outputs:
matrix: ${{ steps.detect.outputs.matrix }}
config: ${{ steps.detect.outputs.config }}
go-mod: ${{ steps.detect.outputs.go-mod }}
steps:
- name: 🔒 Harden runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Each language CodeQL can analyse is included when a tracked file of its kind
# exists; GitHub Actions workflows are always analysed.
- name: 🧭 Detect
id: detect
shell: bash
run: |
set -euo pipefail
entries='{"language":"actions","build-mode":"none"}'
add() { entries="${entries},{\"language\":\"$1\",\"build-mode\":\"$2\"}"; }
has() { [ -n "$(git ls-files -- "$@" | head -n 1)" ]; }
if has 'go.mod' '**/go.mod'; then
add go autobuild
# Set up Go from the root module, or else the first one found below it.
go_mod=go.mod
if ! has 'go.mod'; then go_mod="$(git ls-files -- '**/go.mod' | head -n 1)"; fi
echo "go-mod=${go_mod}" >>"${GITHUB_OUTPUT}"
fi
if has '*.ts' '*.tsx' '*.js' '*.jsx' '*.mjs' '*.cjs' '*.svelte' '*.vue'; then add javascript-typescript none; fi
if has '*.cs' '*.csproj'; then add csharp none; fi
if has '*.py'; then add python none; fi
# Kotlin cannot be analysed without a build; Java alone can.
if has '*.kt'; then add java-kotlin autobuild
elif has '*.java'; then add java-kotlin none; fi
if has '*.rb'; then add ruby none; fi
if has '*.rs'; then add rust none; fi
echo "matrix=[${entries}]" >>"${GITHUB_OUTPUT}"
# An application that has not added its own configuration yet gets the
# security-extended suite instead.
if [ -f .github/codeql/codeql-config.yml ]; then
echo "config=./.github/codeql/codeql-config.yml" >>"${GITHUB_OUTPUT}"
fi
echo "CodeQL languages: [${entries}]"

analyze:
name: Analyze (${{ matrix.language }})
needs: [languages]
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read # checkout
actions: read # workflow metadata for the analysis
security-events: write # upload the results to code scanning
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.languages.outputs.matrix) }}
steps:
- name: 🔒 Harden runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Autobuild compiles each Go module it finds, with the toolchain go.mod asks for.
- name: ⚙️ Set up Go
if: matrix.language == 'go'
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: ${{ needs.languages.outputs.go-mod }}
cache: false
- name: 🔍 Initialize CodeQL
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
config-file: ${{ needs.languages.outputs.config }}
queries: ${{ needs.languages.outputs.config == '' && 'security-extended' || '' }}
- name: 🏗️ Autobuild
if: matrix.build-mode == 'autobuild'
uses: github/codeql-action/autobuild@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
- name: 🔬 Analyze
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
category: /language:${{ matrix.language }}
35 changes: 35 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 🧹 Lint

# Shared lint job, called from ci.yaml so its result counts towards
# CI - Required Checks. The template owns this workflow and template-sync keeps it
# current; configure what it checks in .mega-linter.yml. Go applications do not
# call it: the shared Go validator already runs MegaLinter with signed fixes.
on:
workflow_call:

permissions: {}

jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read # checkout only; findings stay in the job log
steps:
- name: 🔒 Harden runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Read-only: a finding a linter could fix still fails the job, so fix it locally.
- name: 🧹 MegaLinter
uses: oxsecurity/megalinter/flavors/cupcake@f2fe8c1cba37091848df3e524066c8c23ef353ed # v10.2.0
env:
VALIDATE_ALL_CODEBASE: true
APPLY_FIXES: none
# actionlint in MegaLinter does not know the newer `code-quality` permission yet.
ACTION_ACTIONLINT_ARGUMENTS: -ignore code-quality
7 changes: 4 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ permissions: {}

jobs:
release:
# Skipped in the template repo itself; runs in every tenant created from it.
if: github.repository != 'devantler-tech/platform-tenant-template'
uses: devantler-tech/.github/.github/workflows/create-release.yaml@f33622708f9f25a32acb46cc419007e18a3223b3 # v21.3.1
# Skipped in the template repo itself; runs in every application created from it.
# The template is matched by its repository ID, which survives renames.
if: github.repository_id != '1253884448'
uses: devantler-tech/.github/.github/workflows/create-release.yaml@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
with:
disable-issue-side-effects: true
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
triage:
# Keep portfolio automation disabled in external template copies.
if: ${{ github.repository_owner == 'devantler-tech' }}
uses: devantler-tech/.github/.github/workflows/triage-stale-issues.yaml@f33622708f9f25a32acb46cc419007e18a3223b3 # v21.3.1
uses: devantler-tech/.github/.github/workflows/triage-stale-issues.yaml@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
permissions:
issues: write
actions: write
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/template-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ permissions: {}
jobs:
template-sync:
# Skipped in the template repo itself (it is the sync source); runs in every
# tenant created from this template, where it opens a PR with template changes.
if: github.repository != 'devantler-tech/platform-tenant-template'
# application created from this template, where it opens a PR with template
# changes. The template is matched by its repository ID, which survives renames.
if: github.repository_id != '1253884448'
# The reusable workflow's job opens the sync PR, so the caller must grant it
# write to contents + pull-requests. A reusable workflow cannot be granted
# more than the caller, and the top-level `permissions: {}` grants none, so
Expand All @@ -20,7 +21,7 @@ jobs:
permissions:
contents: write
pull-requests: write
uses: devantler-tech/.github/.github/workflows/template-sync.yaml@f33622708f9f25a32acb46cc419007e18a3223b3 # v21.3.1
uses: devantler-tech/.github/.github/workflows/template-sync.yaml@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
with:
source-repo-path: devantler-tech/platform-tenant-template
use-app-token: true
Expand Down
11 changes: 11 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"default": true,
"MD013": false,
"MD024": false,
"MD025": {
"front_matter_title": ""
},
"MD033": false,
"MD041": false,
"MD060": false
}
10 changes: 10 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This application's MegaLinter settings. It extends the shared base, which the
# template owns and template-sync keeps current, so put only what differs here.
# Your values win over the base; the lists named in CONFIG_PROPERTIES_TO_APPEND are
# added to the base's lists instead of replacing them.
# Reference: https://megalinter.io/latest/config-file/
EXTENDS: .github/mega-linter.base.yml
CONFIG_PROPERTIES_TO_APPEND:
- DISABLE
- DISABLE_LINTERS
- EXCLUDED_DIRECTORIES
12 changes: 12 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "stylelint-config-standard",
"rules": {
"import-notation": "string",
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["theme", "source", "utility", "variant", "custom-variant", "plugin", "config", "reference", "apply"]
}
]
}
}
Loading
Loading