From d47162cc90f22d6734b40030834ac0b72a384497 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Tue, 10 Nov 2026 20:58:46 +0000 Subject: [PATCH] Gate deployment on the validated artifact upload result --- .forgejo/workflows/deploy.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 03f81dd..1b95141 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -9,6 +9,8 @@ on: jobs: validate: + outputs: + publish: ${{ steps.validated_build.outcome }} env: PHOTO_ASSET_CACHE_URL: https://photos.schmelczer.dev/static/photos/ runs-on: @@ -50,6 +52,7 @@ jobs: run: npm run test:e2e - name: Save validated build + id: validated_build if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && contains(fromJSON('["andras","ruby336688"]'), github.actor) }} uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 with: @@ -66,7 +69,9 @@ jobs: ${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login == 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref, 'renovate/')) && 'renovate' || 'docker' }} needs: validate - if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && contains(fromJSON('["andras","ruby336688"]'), github.actor) }} + # The upload step evaluates the trusted-main condition on the runner. Pass + # its result to Forgejo's dependent-job scheduler instead of repeating it. + if: ${{ needs.validate.outputs.publish == 'success' }} steps: - name: Download validated build uses: https://github.com/actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a