From bccb425fea6e3c7ff677beece8a71c2a04d5b7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A8=D0=B5=D0=BF?= =?UTF-8?q?=D1=82=D1=83=D0=BD=D0=BE=D0=B2?= Date: Wed, 11 Nov 2026 14:46:14 +0300 Subject: [PATCH] Fix source download in Gitea CI --- .github/workflows/contracts.yml | 28 ++++++++++++++++++++++++---- evidence/ci-checkout.txt | 6 ++++++ 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 evidence/ci-checkout.txt diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index ac47375..534dd65 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -6,7 +6,18 @@ jobs: contracts: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Download source at workflow commit + env: + CI_REPOSITORY: ${{ github.repository }} + CI_REVISION: ${{ github.sha }} + run: | + archive="$(mktemp)" + trap 'rm -f -- "$archive"' EXIT + curl --fail --silent --show-error --location --retry 2 \ + --connect-timeout 10 --max-time 90 \ + "https://gitea.privcloud.tech/$CI_REPOSITORY/archive/$CI_REVISION.tar.gz" \ + --output "$archive" + tar --extract --gzip --file="$archive" --strip-components=1 - uses: actions/setup-python@v5 with: python-version: '3.12' @@ -18,9 +29,18 @@ jobs: env: COMPOSE_PROJECT_NAME: lab7-ci-${{ github.run_id }}-${{ github.run_attempt }} steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false + - name: Download source at workflow commit + env: + CI_REPOSITORY: ${{ github.repository }} + CI_REVISION: ${{ github.sha }} + run: | + archive="$(mktemp)" + trap 'rm -f -- "$archive"' EXIT + curl --fail --silent --show-error --location --retry 2 \ + --connect-timeout 10 --max-time 90 \ + "https://gitea.privcloud.tech/$CI_REPOSITORY/archive/$CI_REVISION.tar.gz" \ + --output "$archive" + tar --extract --gzip --file="$archive" --strip-components=1 - name: Check Docker runtime run: | docker info --format '{{.ServerVersion}}' diff --git a/evidence/ci-checkout.txt b/evidence/ci-checkout.txt new file mode 100644 index 0000000..1829cce --- /dev/null +++ b/evidence/ci-checkout.txt @@ -0,0 +1,6 @@ +Local verification of the Gitea archive used by CI (download and extraction at the event SHA). +python3 scripts/check_contract.py +PASS: offline skeleton structure, local refs and Python syntax; application NOT tested. +/home/kitsune/visotka/mtusi2026lab7/.venv/bin/python scripts/validate_openapi.py +PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested. +PASS archive 494d6365e501fb5da2660ba783d7863ae3f52702