Skip to content

Commit 1229133

Browse files
committed
[build] manual trigger job needs an approval step to limit
1 parent 1cc4bc7 commit 1229133

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/restrict-trunk.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,21 @@ on:
2525
type: boolean
2626

2727
jobs:
28+
approve:
29+
name: Approve Manual Trigger
30+
runs-on: ubuntu-latest
31+
if: github.event_name == 'workflow_dispatch' && github.event.repository.fork == false
32+
environment: production
33+
steps:
34+
- run: echo "Manual trigger approved"
35+
2836
manage-trunk:
2937
name: Manage Trunk Branch
38+
needs: [approve]
3039
runs-on: ubuntu-latest
3140
if: |
41+
always() &&
42+
(needs.approve.result == 'success' || needs.approve.result == 'skipped') &&
3243
github.event.repository.fork == false &&
3344
(github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' ||
3445
(startsWith(github.event.pull_request.head.ref, 'release-preparation-') &&

0 commit comments

Comments
 (0)