Merge pull request #17 from kevinveenbirkenbach/chore/repository-bot-baseline

chore(github): add the repository bot baseline
This commit is contained in:
Kevin Veen-Birkenbach authored and GitHub committed 2026-12-01 08:40:29 +01:00
commit 6ba77c4f58
11 files changed
+157 -138

No files matched your search

+1
View File
@@ -0,0 +1 @@
* @kevinveenbirkenbach
+9 -7
View File
@@ -5,19 +5,21 @@ updates:
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "00:00"
rebase-strategy: "auto"
open-pull-requests-limit: 0
groups:
pip-security:
applies-to: security-updates
patterns: ["*"]
labels:
- "dependencies"
- "python"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "00:00"
groups:
github-actions:
applies-to: version-updates
patterns: ["*"]
labels:
- "dependencies"
- "ci"
+2 -7
View File
@@ -46,15 +46,10 @@ jobs:
contents: read
uses: ./.github/workflows/test-e2e.yml
test-virgin-user:
test-virgin:
permissions:
contents: read
uses: ./.github/workflows/test-virgin-user.yml
test-virgin-root:
permissions:
contents: read
uses: ./.github/workflows/test-virgin-root.yml
uses: ./.github/workflows/test-virgin.yml
lint-shell:
permissions:
+41
View File
@@ -0,0 +1,41 @@
name: Scorecard supply-chain security
on:
branch_protection_rule:
schedule:
- cron: '00 00 * * *'
push:
branches: [ "main" ]
concurrency:
group: scorecard-${{ github.repository }}-${{ github.ref_name }}
cancel-in-progress: true
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
if: github.event.repository.default_branch == github.ref_name
permissions:
security-events: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4.2.2
with:
persist-credentials: false
- name: Run analysis
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: results.sarif
-56
View File
@@ -1,56 +0,0 @@
name: Test Virgin Root
on:
workflow_call:
permissions:
contents: read
jobs:
test-virgin-root:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
distro: [arch, debian, ubuntu, fedora, centos]
env:
NIX_CONFIG: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Show Docker version
run: docker version
- name: Pull base image (${{ matrix.distro }})
run: docker pull "ghcr.io/kevinveenbirkenbach/base-${{ matrix.distro }}:latest"
- name: Virgin ${{ matrix.distro }} pkgmgr test (root)
run: |
set -euo pipefail
docker run --rm \
-v "$PWD":/opt/src/pkgmgr \
-v pkgmgr_repos:/root/Repositories \
-v pkgmgr_pip_cache:/root/.cache/pip \
-e NIX_CONFIG="${NIX_CONFIG}" \
-w /opt/src/pkgmgr \
"ghcr.io/kevinveenbirkenbach/base-${{ matrix.distro }}:latest" \
bash -lc '
set -euo pipefail
git config --global --add safe.directory /opt/src/pkgmgr
make install
make setup
. "$HOME/.venvs/pkgmgr/bin/activate"
pkgmgr update pkgmgr --clone-mode shallow --no-verification
pkgmgr version pkgmgr
echo ">>> Running Nix-based: nix run .#pkgmgr -- version pkgmgr"
nix run /opt/src/pkgmgr#pkgmgr -- version pkgmgr
'
-68
View File
@@ -1,68 +0,0 @@
name: Test Virgin User
on:
workflow_call:
permissions:
contents: read
jobs:
test-virgin-user:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
distro: [arch, debian, ubuntu, fedora, centos]
env:
NIX_CONFIG: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Show Docker version
run: docker version
- name: Pull base image (${{ matrix.distro }})
run: docker pull "ghcr.io/kevinveenbirkenbach/base-${{ matrix.distro }}:latest"
- name: Virgin ${{ matrix.distro }} pkgmgr test (user)
run: |
set -euo pipefail
docker run --rm \
-v "$PWD":/opt/src/pkgmgr \
-e NIX_CONFIG="${NIX_CONFIG}" \
-w /opt/src/pkgmgr \
"ghcr.io/kevinveenbirkenbach/base-${{ matrix.distro }}:latest" \
bash -lc '
set -euo pipefail
make install
useradd -m dev
echo "dev ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/dev
chmod 0440 /etc/sudoers.d/dev
chown -R dev:dev /opt/src/pkgmgr
mkdir -p /nix/store /nix/var/nix /nix/var/log/nix /nix/var/nix/profiles
chown -R dev:dev /nix
chmod 0755 /nix
chmod 1777 /nix/store
sudo -H -u dev env \
HOME=/home/dev \
NIX_CONFIG="$NIX_CONFIG" \
PKGMGR_DISABLE_NIX_FLAKE_INSTALLER=1 \
bash -lc "
set -euo pipefail
cd /opt/src/pkgmgr
make setup-venv
. \"\$HOME/.venvs/pkgmgr/bin/activate\"
pkgmgr version pkgmgr
export NIX_REMOTE=local
nix run /opt/src/pkgmgr#pkgmgr -- version pkgmgr
"
'
+34
View File
@@ -0,0 +1,34 @@
name: Test Virgin
on:
workflow_call:
permissions:
contents: read
jobs:
test-virgin:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
mode: [user, root]
distro: [arch, debian, ubuntu, fedora, centos]
env:
NIX_CONFIG: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
MODE: ${{ matrix.mode }}
DISTRO: ${{ matrix.distro }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Show Docker version
run: docker version
- name: Pull base image (${{ matrix.distro }})
run: docker pull "ghcr.io/kevinveenbirkenbach/base-${DISTRO}:latest"
- name: Virgin ${{ matrix.distro }} pkgmgr test (${{ matrix.mode }})
run: bash scripts/test/virgin/run.sh "$MODE" "$DISTRO"
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
cd /opt/src/pkgmgr
make setup-venv
# shellcheck source=/dev/null
. "$HOME/.venvs/pkgmgr/bin/activate"
pkgmgr version pkgmgr
export NIX_REMOTE=local
nix run /opt/src/pkgmgr#pkgmgr -- version pkgmgr
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
git config --global --add safe.directory /opt/src/pkgmgr
make install
make setup
# shellcheck source=/dev/null
. "$HOME/.venvs/pkgmgr/bin/activate"
pkgmgr update pkgmgr --clone-mode shallow --no-verification
pkgmgr version pkgmgr
nix run /opt/src/pkgmgr#pkgmgr -- version pkgmgr
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
mode="$1"
distro="$2"
case "$mode" in
root) volumes=(-v pkgmgr_repos:/root/Repositories -v pkgmgr_pip_cache:/root/.cache/pip) ;;
user) volumes=() ;;
*)
echo "usage: $0 root|user <distro>" >&2
exit 2
;;
esac
docker run --rm \
-v "$PWD":/opt/src/pkgmgr \
"${volumes[@]}" \
-e NIX_CONFIG="${NIX_CONFIG}" \
-w /opt/src/pkgmgr \
"ghcr.io/kevinveenbirkenbach/base-${distro}:latest" \
bash -l "scripts/test/virgin/${mode}.sh"
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
make install
useradd -m dev
echo "dev ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/dev
chmod 0440 /etc/sudoers.d/dev
chown -R dev:dev /opt/src/pkgmgr
mkdir -p /nix/store /nix/var/nix /nix/var/log/nix /nix/var/nix/profiles
chown -R dev:dev /nix
chmod 0755 /nix
chmod 1777 /nix/store
sudo -H -u dev env \
HOME=/home/dev \
NIX_CONFIG="$NIX_CONFIG" \
PKGMGR_DISABLE_NIX_FLAKE_INSTALLER=1 \
bash -l /opt/src/pkgmgr/scripts/test/virgin/dev.sh