Skip to content

Commit 385be25

Browse files
Add support for external contributors
Change-type: patch Signed-off-by: Vipul Gupta (@vipulgupta2048) <[email protected]>
1 parent afa45bf commit 385be25

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

.github/workflows/flowzone.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,28 @@ name: Flowzone
33
on:
44
pull_request:
55
types: [opened, synchronize, closed]
6-
branches:
7-
- "main"
8-
- "master"
6+
branches: [main, master]
7+
# allow external contributions to use secrets within trusted code
8+
pull_request_target:
9+
types: [opened, synchronize, closed]
10+
branches: [main, master]
911

1012
jobs:
1113
flowzone:
1214
name: Flowzone
1315
uses: product-os/flowzone/.github/workflows/flowzone.yml@master
16+
# prevent duplicate workflow executions for pull_request and pull_request_target
17+
if: |
18+
(
19+
github.event.pull_request.head.repo.full_name == github.repository &&
20+
github.event_name == 'pull_request'
21+
) || (
22+
github.event.pull_request.head.repo.full_name != github.repository &&
23+
github.event_name == 'pull_request_target'
24+
)
25+
26+
# Workflows in the same org or enterprise can use the inherit keyword to pass secrets implicitly
1427
secrets: inherit
1528
with:
1629
balena_slugs: balena_io_examples/balena-nodejs-hello-world
30+

0 commit comments

Comments
 (0)