Skip to content

Commit 652afc0

Browse files
Merge pull request #38 from balena-io-examples/vipulgupta2048-patch-1
patch: Add support for external contributors
2 parents 2fdacb9 + 31cf290 commit 652afc0

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/flowzone.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,27 @@ 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-python-hello-world

0 commit comments

Comments
 (0)