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
88 changes: 0 additions & 88 deletions .github/.workflows/build_publish.yml

This file was deleted.

21 changes: 13 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/.docker/"
schedule:
interval: "daily"
interval: daily
cooldown:
default-days: 7
groups:
routine-actions:
applies-to: version-updates
patterns: ["*"]
update-types: ["minor", "patch"]
open-pull-requests-limit: 10
27 changes: 27 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Actionlint

on:
pull_request:
push:
branches: [main]
permissions:
contents: read

jobs:
actionlint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# actionlint v1.7.12 does not yet parse GitHub's supported $/ self-repository syntax.
# Remove the narrowly scoped diagnostic workaround after rhysd/actionlint#711 lands.
- name: Validate GitHub Actions workflow syntax and expressions
run: |
# renovate: datasource=docker depName=rhysd/actionlint
docker run --rm --volume "$PWD:/repo:ro" --workdir /repo \
rhysd/actionlint:1.7.12@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667 -color \
-ignore 'reusable workflow call "\$/.github/workflows/image-(ci|release)\.yml" at "uses" is not following the format'
117 changes: 117 additions & 0 deletions .github/workflows/image-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Image CI

on:
pull_request:
branches: [main]
workflow_call:
workflow_dispatch:
schedule:
- cron: "17 9 * * *"

permissions:
contents: read

concurrency:
group: janus-ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
policy:
name: Bats policy and release checks
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Bats
uses: bats-core/bats-action@77d6fb60505b4d0d1d73e48bd035b55074bbfb43 # 4.0.0
with:
support-install: false
assert-install: false
detik-install: false
file-install: false
- name: Run policy tests
run: bats tests/policy.bats tests/release.bats tests/scan-images.bats
- name: ShellCheck vulnerability scanner wrapper
run: shellcheck scripts/scan-images.sh
- name: Validate immutable Compose example
shell: bash
run: |
tag="ci"
digest="sha256:$(printf '%064d' 0)"
JANUS_IMAGE_TAG="$tag" JANUS_IMAGE_DIGEST="$digest" docker compose config --quiet

image:
name: Build and Bats test (${{ matrix.platform }})
needs: policy
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [linux/amd64, linux/arm64]
include:
- platform: linux/amd64
arch: amd64
- platform: linux/arm64
arch: arm64
permissions:
contents: read
security-events: write
steps:
- name: Checkout sources
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Bats
uses: bats-core/bats-action@77d6fb60505b4d0d1d73e48bd035b55074bbfb43 # 4.0.0
with:
support-install: false
assert-install: false
detik-install: false
file-install: false
- name: Enable ARM emulation
if: matrix.arch == 'arm64'
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
with:
platforms: arm64
- name: Setup Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Build without publishing
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
pull: true
platforms: ${{ matrix.platform }}
load: true
push: false
tags: janus-ci:verify
cache-from: type=gha,scope=janus-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=janus-${{ matrix.arch }}
- name: Run Bats runtime tests
env:
JANUS_TEST_IMAGE: janus-ci:verify
run: bats tests/image.bats
- name: Install Trivy
uses: aquasecurity/setup-trivy@81e514348e19b6112ce2a7e3ecbafe19c1e1f567 # v0.3.1
with:
# renovate: datasource=github-releases depName=aquasecurity/trivy
version: v0.75.0
cache: true
- name: Scan image and export SARIF
run: bash scripts/scan-images.sh "janus@${{ matrix.platform }}=janus-ci:verify"
- name: Upload vulnerability report
if: always() && hashFiles('trivy-results/*.sarif') != ''
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: trivy-janus-${{ matrix.arch }}
path: trivy-results/*.sarif
if-no-files-found: error
- name: Publish SARIF to code scanning
if: always() && github.ref == 'refs/heads/main' && github.event_name == 'push' && hashFiles('trivy-results/*.sarif') != ''
uses: github/codeql-action/upload-sarif@4bfa242aa49c5f7c6770b98670d354a7dfac05f8 # v3.39.1
with:
sarif_file: trivy-results/janus-linux-${{ matrix.arch }}.sarif
category: trivy-janus-linux-${{ matrix.arch }}
116 changes: 116 additions & 0 deletions .github/workflows/image-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Publish image and GitHub Release

on:
push:
branches: [main]
# Documentation-only changes do not create a new container release.
paths-ignore:
- 'README.md'
- 'docs/**'
- 'CONTRIBUTING.md'
- 'SECURITY.md'
- 'AGENTS.md'

permissions:
contents: read

concurrency:
group: janus-commit-publish-${{ github.ref }}
cancel-in-progress: false

env:
IMAGE: ghcr.io/librecodecoop/janus

jobs:
validate:
if: github.ref == 'refs/heads/main'
uses: $/.github/workflows/image-ci.yml
permissions:
contents: read
security-events: write

publish-commit:
name: Publish tested commit image
if: github.ref == 'refs/heads/main'
needs: validate
runs-on: ubuntu-latest
outputs:
digest: ${{ steps.staged.outputs.digest }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
with:
platforms: arm64
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Reject existing immutable commit image
run: |
if docker buildx imagetools inspect "$IMAGE:sha-$GITHUB_SHA" >/dev/null 2>&1; then
echo "Commit image already published; refusing to overwrite its tag" >&2
exit 1
fi
- name: Build OCI index with SBOM and provenance, staged by digest
id: staged
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
pull: true
platforms: linux/amd64,linux/arm64
outputs: type=image,name=ghcr.io/librecodecoop/janus,push-by-digest=true,name-canonical=true,push=true
provenance: mode=max
sbom: true
cache-from: |
type=gha,scope=janus-amd64
type=gha,scope=janus-arm64
cache-to: type=gha,mode=max,scope=janus-publish
- name: Install Trivy
uses: aquasecurity/setup-trivy@81e514348e19b6112ce2a7e3ecbafe19c1e1f567 # v0.3.1
with:
# renovate: datasource=github-releases depName=aquasecurity/trivy
version: v0.75.0
cache: true
- name: Scan the exact published OCI digest on both platforms
env:
DIGEST: ${{ steps.staged.outputs.digest }}
run: |
set -eu
test -n "$DIGEST"
bash scripts/scan-images.sh "janus@linux/amd64=$IMAGE@$DIGEST"
bash scripts/scan-images.sh "janus@linux/arm64=$IMAGE@$DIGEST"
- name: Preserve staged-image security results
if: always() && hashFiles('trivy-results/*.sarif') != ''
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: trivy-janus-staged
path: trivy-results/*.sarif
if-no-files-found: error
- name: Promote scanned digest to immutable commit tag
env:
DIGEST: ${{ steps.staged.outputs.digest }}
run: |
set -eu
docker buildx imagetools create --tag "$IMAGE:sha-$GITHUB_SHA" "$IMAGE@$DIGEST"
docker buildx imagetools inspect --raw "$IMAGE:sha-$GITHUB_SHA" > commit-index.json
test "$(sha256sum commit-index.json | cut -d ' ' -f1)" = "${DIGEST#sha256:}"
echo "Commit image: $IMAGE:sha-$GITHUB_SHA@$DIGEST" >> "$GITHUB_STEP_SUMMARY"

auto-release:
name: Automatically publish new version and GitHub Release
needs: publish-commit
permissions:
contents: write
packages: write
uses: $/.github/workflows/image-release.yml
with:
expected_digest: ${{ needs.publish-commit.outputs.digest }}
Loading
Loading