From 835e0be8f3b198173110c1c7b3773739b3de1c9d Mon Sep 17 00:00:00 2001 From: Henrik Brautaset Aronsen Date: Fri, 21 Nov 2025 10:07:59 +0100 Subject: [PATCH] feat: Check that ENTUR_DOCS_SA exists ref https://github.com/entur/gha-api/pull/88 --- .github/workflows/publish.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 50ed3c4..03fac4a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,6 +28,20 @@ jobs: run: | echo "GHA_DOCS_PUBLISH_PROJECT=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - uses: actions/checkout@v4 + - name: Check for ENTUR_DOCS_SA secret + env: + ENTUR_DOCS_SA: ${{ secrets.ENTUR_DOCS_SA }} + REPO_VISIBILITY: ${{ github.event.repository.visibility }} + run: | + if [ -z "${ENTUR_DOCS_SA}" ]; then + if [ "${REPO_VISIBILITY}" = "public" ]; then + echo "::error::Upload to bucket will not work out of the box for public repositories, due to the \ + repository secret ENTUR_DOCS_SA not being available. Ask Team Plattform to add it." + else + echo "::error::The repository secret ENTUR_DOCS_SA is not available. Please ensure it is configured." + fi + exit 1 + fi - id: auth uses: google-github-actions/auth@v2 with: