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 .github/RELEASE_NOTES_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!--
Patch record of a release. Create the release with:

gh release create vX.Y.Z --generate-notes --notes-file .github/RELEASE_NOTES_TEMPLATE.md

Then edit the release: fill in the fields below, and add the deploy date once the
release is running in production.
-->

## Patch record

- Release tag: vX.Y.Z
- Deployed to production: YYYY-MM-DD
- Components updated: list them here. A grouped Dependabot pull request shows only its group name under "Dependency updates", so copy the packages from its description.
- CVEs and advisories addressed: none
39 changes: 39 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Dependabot version updates.
#
# Update pull requests are opened on the first day of each month, so they are ready
# for the monthly patch cycle. Minor and patch updates are grouped into one pull
# request per ecosystem; a major update gets its own pull request.
#
# Security alerts do not depend on this file: they are a repository setting.
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 5
groups:
composer-minor-and-patch:
patterns:
- "*"
update-types:
- "minor"
- "patch"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 5
groups:
npm-minor-and-patch:
patterns:
- "*"
update-types:
- "minor"
- "patch"

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
11 changes: 11 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Categories for automatically generated release notes.
# Dependabot labels its pull requests "dependencies", so the components that a
# release updates are listed on their own for the patch record.
changelog:
categories:
- title: Dependency updates
labels:
- dependencies
- title: Other changes
labels:
- "*"
72 changes: 72 additions & 0 deletions .github/workflows/dependency_audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Dependency Audit

on:
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 6 * * 1' # Mondays at 06:00 UTC
workflow_dispatch:

permissions:
contents: read

jobs:
# Blocks a pull request that adds a dependency, or updates one to a version,
# with a known vulnerability of high or critical severity.
dependency-review:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Review dependency changes
uses: actions/dependency-review-action@v5.0.1
with:
fail-on-severity: high
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
# The default covers runtime dependencies only.
fail-on-scopes: runtime, development, unknown

# Audits every dependency in the lock files.
# The Composer audit blocks. The Yarn audit only reports for now: main still
# has npm advisories that predate this workflow, so a blocking audit would
# fail every pull request. Remove its "continue-on-error" line once those
# advisories are patched or accepted.
audit:
runs-on: ubuntu-latest
env:
PHP_VERSION: 8.3
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: ${{env.PHP_VERSION}}
tools: composer:v2
coverage: none
- name: Composer audit
run: composer audit --locked --abandoned=report --ignore-severity=low --ignore-severity=medium
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '22'
# Every group is audited: the frontend is bundled, so packages declared
# under devDependencies (react, superagent) also ship to the browser.
- name: Yarn audit
continue-on-error: true
run: |
set +e
# The exit code of yarn 1 cannot tell a failed audit from a clean one
# (both can be 1), so the result is read from the JSON summary.
yarn audit --json > yarn-audit.jsonl
summary=$(jq -c 'select(.type == "auditSummary") | .data.vulnerabilities' yarn-audit.jsonl | tail -n 1)
if [ -z "$summary" ]; then
echo "yarn audit did not complete:"
head -n 20 yarn-audit.jsonl
exit 1
fi
echo "Vulnerabilities by severity: $summary"
if [ "$(echo "$summary" | jq '.high + .critical')" -gt 0 ]; then
yarn audit --level high
exit 1
fi
Loading