diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3eb7b71..ed0a87c 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@v6 + - 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@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0 with: