ci: skip actions/checkout — do manual git clone (checkout does git init without --object-format=sha256)
Some checks failed
validate / Rego (opa fmt + opa test) (push) Successful in 12s
validate / JSON Schema (ajv) (push) Failing after 15s

This commit is contained in:
CTO Agent 2026-10-25 15:40:01 +00:00
parent 0a3ae36bf1
commit 23594e1f9b

View file

@ -6,8 +6,10 @@ on:
branches: [main] branches: [main]
# The repository uses the sha256 git object format. Git < 2.42 cannot speak # The repository uses the sha256 git object format. Git < 2.42 cannot speak
# the sha256 wire protocol, so we must run the job in a container whose Debian # the sha256 wire protocol, and actions/checkout@v4 does `git init` without
# base has a recent-enough git (bookworm ships 2.39, trixie ships 2.47+). # --object-format=sha256, which produces `fatal: mismatched algorithms:
# client sha1; server sha256`. We therefore skip actions/checkout entirely
# and clone manually from a trixie-based container (git 2.47+).
jobs: jobs:
json-schema: json-schema:
name: JSON Schema (ajv) name: JSON Schema (ajv)
@ -21,19 +23,23 @@ jobs:
apt-get update apt-get update
apt-get install -y --no-install-recommends git curl ca-certificates apt-get install -y --no-install-recommends git curl ca-certificates
git --version git --version
node --version
- name: Checkout - name: Clone repository (sha256-aware)
uses: actions/checkout@v4 run: |
with: set -euo pipefail
fetch-depth: 0 git clone --depth=1 --branch="${GITHUB_REF_NAME}" \
"https://x-access-token:${GITHUB_TOKEN}@forgejo.basicstack.de/${GITHUB_REPOSITORY}.git" "${GITHUB_WORKSPACE}"
cd "${GITHUB_WORKSPACE}"
git log -1 --oneline
- name: Install ajv-cli + ajv-formats - name: Install ajv-cli + ajv-formats
working-directory: ${{ github.workspace }}
run: | run: |
set -euo pipefail set -euo pipefail
npm install --prefix /tmp/ajv ajv-cli@5 ajv-formats@3 npm install --prefix /tmp/ajv ajv-cli@5 ajv-formats@3
- name: Validate every JSON Schema parses as JSON - name: Validate every JSON Schema parses as JSON
working-directory: ${{ github.workspace }}
run: | run: |
set -euo pipefail set -euo pipefail
find schemas -type f -name '*.json' -print | while read -r f; do find schemas -type f -name '*.json' -print | while read -r f; do
@ -42,6 +48,7 @@ jobs:
done done
- name: Meta-validate each schema against JSON Schema 2020-12 - name: Meta-validate each schema against JSON Schema 2020-12
working-directory: ${{ github.workspace }}
run: | run: |
set -euo pipefail set -euo pipefail
export NODE_PATH=/tmp/ajv/node_modules export NODE_PATH=/tmp/ajv/node_modules
@ -51,6 +58,7 @@ jobs:
done done
- name: Validate example payloads against their schemas (if any) - name: Validate example payloads against their schemas (if any)
working-directory: ${{ github.workspace }}
run: | run: |
set -euo pipefail set -euo pipefail
export NODE_PATH=/tmp/ajv/node_modules export NODE_PATH=/tmp/ajv/node_modules
@ -77,10 +85,13 @@ jobs:
apt-get install -y --no-install-recommends git curl ca-certificates apt-get install -y --no-install-recommends git curl ca-certificates
git --version git --version
- name: Checkout - name: Clone repository (sha256-aware)
uses: actions/checkout@v4 run: |
with: set -euo pipefail
fetch-depth: 0 git clone --depth=1 --branch="${GITHUB_REF_NAME}" \
"https://x-access-token:${GITHUB_TOKEN}@forgejo.basicstack.de/${GITHUB_REPOSITORY}.git" "${GITHUB_WORKSPACE}"
cd "${GITHUB_WORKSPACE}"
git log -1 --oneline
- name: Install OPA - name: Install OPA
run: | run: |
@ -92,7 +103,9 @@ jobs:
"$HOME/.local/bin/opa" version "$HOME/.local/bin/opa" version
- name: opa fmt (fail on any diff) - name: opa fmt (fail on any diff)
working-directory: ${{ github.workspace }}
run: opa fmt --list --diff policies/ run: opa fmt --list --diff policies/
- name: opa test - name: opa test
working-directory: ${{ github.workspace }}
run: opa test policies/ -v run: opa test policies/ -v