Skip to content

Commit 0831469

Browse files
authored
Merge pull request #296 from freeswitch/gha
[GHA] Add manual trigger, disable `deb-mirror` on forks
2 parents 1799a0d + 322aa2b commit 0831469

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
paths:
99
- "**"
1010
workflow_dispatch:
11+
inputs:
12+
publish:
13+
description: 'Publish build data'
14+
required: true
15+
default: false
16+
type: boolean
1117

1218
concurrency:
1319
group: ${{ github.head_ref || github.ref }}
@@ -43,7 +49,11 @@ jobs:
4349
META_FILE_PATH_PREFIX: /var/www/sofia-sip/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}
4450
PLATFORM: ${{ matrix.platform.name }}
4551
TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact
46-
UPLOAD_BUILD_ARTIFACTS: ${{ github.event_name != 'pull_request' }}
52+
UPLOAD_BUILD_ARTIFACTS: >-
53+
${{
54+
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish)) &&
55+
(!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)
56+
}}
4757
secrets:
4858
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}
4959
HOSTNAME: ${{ secrets.HOSTNAME }}
@@ -53,7 +63,11 @@ jobs:
5363

5464
deb-mirror:
5565
name: 'DEB-MIRROR'
56-
if: ${{ github.event_name != 'pull_request' }}
66+
if: >-
67+
${{
68+
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish)) &&
69+
(!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)
70+
}}
5771
needs:
5872
- deb
5973
runs-on: ubuntu-latest
@@ -115,7 +129,11 @@ jobs:
115129

116130
meta:
117131
name: 'Publish build data to meta-repo'
118-
if: ${{ github.event_name != 'pull_request' }}
132+
if: >-
133+
${{
134+
github.event_name == 'push' ||
135+
(github.event_name == 'workflow_dispatch' && inputs.publish)
136+
}}
119137
needs:
120138
- deb
121139
- deb-mirror

0 commit comments

Comments
 (0)