Skip to content

Commit 397dcc2

Browse files
committed
ci(deploy): run push deployments without actor-guard dependency
Deploy runs on deploy/* branch push events. The previous job dependency caused push-triggered deploy jobs to be skipped when the guard job was skipped.\n\nRun the guard job for all triggers but skip authorization checks on push events, and require guard success for deploy job.
1 parent a94508a commit 397dcc2

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,22 @@ concurrency:
6060

6161
jobs:
6262
release_actor_guard:
63-
# On push to deploy/* branches, we rely on environment branch policies + branch protection.
64-
# Manual/workflow_call triggers must pass the actor guard before deploying.
65-
if: ${{ github.event_name != 'push' && (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') }}
6663
name: Release actor guard
6764
permissions:
6865
contents: read
6966
runs-on: ubuntu-latest
7067
steps:
68+
- name: Skip actor guard for deploy/* push events
69+
if: github.event_name == 'push'
70+
run: |
71+
set -euo pipefail
72+
echo "Push-triggered deploy; relying on environment protection rules + branch protection."
73+
7174
- name: Checkout
75+
if: github.event_name != 'push'
7276
uses: actions/checkout@v4
7377
- name: Authorize release actor
78+
if: github.event_name != 'push'
7479
uses: ./.github/actions/release-actor-guard
7580
with:
7681
team_slug: release-admins
@@ -80,7 +85,7 @@ jobs:
8085
runs-on: ubuntu-latest
8186
# Deploy branches are promoted from release workflows. Those pushes may be authored by bots,
8287
# and we prefer deploying via explicit workflow_call (to avoid relying on push-trigger semantics).
83-
if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || startsWith(github.ref_name, 'deploy/production/') || startsWith(github.ref_name, 'deploy/preview/')) && (github.event_name == 'push' || needs.release_actor_guard.result == 'success') }}
88+
if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || startsWith(github.ref_name, 'deploy/production/') || startsWith(github.ref_name, 'deploy/preview/')) && needs.release_actor_guard.result == 'success' }}
8489
environment: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.environment || (startsWith(github.ref_name, 'deploy/production/') && 'production' || 'preview') }}
8590
steps:
8691
- name: Enforce trusted refs for manual dispatch

0 commit comments

Comments
 (0)