Skip to content

Commit 58f83ac

Browse files
committed
Do not run twice in pull requests, run for push for local branches and on pull request for foreign origins
Signed-off-by: DL6ER <[email protected]>
1 parent 34c2e98 commit 58f83ac

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/ftl-build.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
name: ftl-build builds
22
on:
3-
pull_request:
4-
paths:
5-
- 'ftl-build/**'
6-
- '.github/workflows/ftl-build.yml'
73
push:
84
branches:
95
- '**'
10-
tags:
11-
- "**"
126
paths:
137
- 'ftl-build/**'
148
- '.github/workflows/ftl-build.yml'
159
- '.github/actions/**'
10+
# Only run on push events to the main repository (not from forks)
11+
pull_request:
12+
types: [opened, synchronize, reopened]
13+
paths:
14+
- 'ftl-build/**'
15+
- '.github/workflows/ftl-build.yml'
16+
# Only run on PRs from forks
17+
branches:
18+
- '**'
1619
workflow_dispatch:
1720
schedule:
1821
# 1:30am UTC every Sunday, has no particular significance
@@ -24,6 +27,9 @@ env:
2427

2528
jobs:
2629
build-and-test:
30+
if: |
31+
(github.event_name == 'push' && github.repository == 'pi-hole/docker-base-images') ||
32+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
2733
runs-on: ubuntu-latest
2834
strategy:
2935
fail-fast: false

0 commit comments

Comments
 (0)