From 43e4f09d347c05a9889914faec90936b952d8b71 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Thu, 3 Dec 2026 10:30:05 +0100 Subject: [PATCH] ci: access private at-mintel with a read token, vendor smoke-test action mmintel/at-mintel is now private (its committed .env was publicly readable), so anonymous ls-remote/clone/raw access fails. Use the read-only MINTEL_PRIVATE_TOKEN secret for every access. Co-Authored-By: Claude Opus 5.5 The core-smoke-tests action is vendored because the runner cannot fetch actions from a private repo. --- .gitea/actions/core-smoke-tests/action.yml | 41 ++++++++++++++++++++++ .gitea/workflows/deploy.yml | 18 +++++----- 2 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 .gitea/actions/core-smoke-tests/action.yml diff --git a/.gitea/actions/core-smoke-tests/action.yml b/.gitea/actions/core-smoke-tests/action.yml new file mode 100644 index 0000000..879a288 --- /dev/null +++ b/.gitea/actions/core-smoke-tests/action.yml @@ -0,0 +1,41 @@ +name: "Mintel Core Smoke Tests" +description: "Executes standard fast HTTP, API, and Locale validation checks." + +inputs: + TARGET_URL: + description: 'The deployed URL to test against' + required: true + GATEKEEPER_PASSWORD: + description: 'Gatekeeper bypass password' + required: true + UMAMI_API_ENDPOINT: + description: 'Umami Analytics Endpoint' + required: false + default: 'https://analytics.infra.mintel.me' + SENTRY_DSN: + description: 'Sentry / Glitchtip DSN' + required: false + +runs: + using: "composite" + steps: + - name: 🌐 Full Sitemap HTTP Validation + shell: bash + env: + NEXT_PUBLIC_BASE_URL: ${{ inputs.TARGET_URL }} + GATEKEEPER_PASSWORD: ${{ inputs.GATEKEEPER_PASSWORD }} + run: pnpm run check:http + + - name: 🌐 Locale & Language Switcher Validation + shell: bash + env: + NEXT_PUBLIC_BASE_URL: ${{ inputs.TARGET_URL }} + GATEKEEPER_PASSWORD: ${{ inputs.GATEKEEPER_PASSWORD }} + run: pnpm run check:locale + + - name: 🌐 External API Smoke Test (Umami & Sentry) + shell: bash + env: + UMAMI_API_ENDPOINT: ${{ inputs.UMAMI_API_ENDPOINT }} + SENTRY_DSN: ${{ inputs.SENTRY_DSN }} + run: pnpm run check:apis diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 6693a3e..a2199e5 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -110,21 +110,22 @@ jobs: TAG_TO_WAIT="v$UPSTREAM_VERSION" if [[ -n "$UPSTREAM_VERSION" && "$UPSTREAM_VERSION" != "workspace:"* ]]; then - # 1. Discovery (Works without token for public repositories) - UPSTREAM_SHA=$(git ls-remote --tags https://git.infra.mintel.me/mmintel/at-mintel.git "$TAG_TO_WAIT" | grep "$TAG_TO_WAIT" | tail -n1 | awk '{print $1}') - + # mmintel/at-mintel is private: every access needs a read token (MINTEL_PRIVATE_TOKEN). + POLL_TOKEN="${{ secrets.GITEA_PAT || secrets.MINTEL_PRIVATE_TOKEN }}" + + # 1. Discovery + UPSTREAM_SHA=$(git ls-remote --tags "https://ci:${POLL_TOKEN}@git.infra.mintel.me/mmintel/at-mintel.git" "$TAG_TO_WAIT" | grep "$TAG_TO_WAIT" | tail -n1 | awk '{print $1}') + if [[ -z "$UPSTREAM_SHA" ]]; then echo "❌ Error: Tag $TAG_TO_WAIT not found in mmintel/at-mintel." exit 1 fi echo "✅ Tag verified: Found upstream SHA $UPSTREAM_SHA for $TAG_TO_WAIT" - # 2. Status Check (Requires PAT for cross-repo API access) - POLL_TOKEN="${{ secrets.GITEA_PAT || secrets.MINTEL_PRIVATE_TOKEN }}" - + # 2. Status Check if [[ -n "$POLL_TOKEN" ]]; then echo "⏳ POLL_TOKEN found. Checking upstream build status..." - curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + curl -sf -H "Authorization: token $POLL_TOKEN" \ "https://git.infra.mintel.me/mmintel/at-mintel/raw/branch/main/packages/infra/scripts/wait-for-upstream.sh" > wait-for-upstream.sh chmod +x wait-for-upstream.sh GITEA_TOKEN="$POLL_TOKEN" ./wait-for-upstream.sh "mmintel/at-mintel" "$TAG_TO_WAIT" @@ -400,7 +401,8 @@ jobs: - name: 🌐 Core Smoke Tests (HTTP, API, Locale) if: always() && steps.deps.outcome == 'success' - uses: https://git.infra.mintel.me/mmintel/at-mintel/.gitea/actions/core-smoke-tests@main + # vendored from mmintel/at-mintel (private repo, the runner cannot fetch actions from it) + uses: ./.gitea/actions/core-smoke-tests with: TARGET_URL: ${{ needs.prepare.outputs.next_public_url }} GATEKEEPER_PASSWORD: ${{ secrets.GATEKEEPER_PASSWORD || vars.GATEKEEPER_PASSWORD }}