Skip to content

Commit 70a3578

Browse files
committed
[GHA] Rework upload expression and add verification for nonce job
1 parent d671dc0 commit 70a3578

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ concurrency:
2121
jobs:
2222
get-nonce:
2323
name: 'Get Nonce for token'
24+
if: |
25+
(
26+
github.event_name == 'pull_request' &&
27+
github.event.pull_request.head.repo.full_name != github.repository &&
28+
!contains(github.event.pull_request.changed_files, '.github/')
29+
) ||
30+
github.event_name == 'push' ||
31+
github.event.pull_request.head.repo.full_name == github.repository ||
32+
github.actor == github.repository_owner
2433
runs-on: freeswitch-org-auth-client
2534
outputs:
2635
nonce: ${{ steps.get-nonce.outputs.nonce }}
@@ -52,9 +61,7 @@ jobs:
5261
${{
5362
github.event_name == 'push' ||
5463
github.event.pull_request.head.repo.full_name == github.repository ||
55-
github.actor == github.repository_owner ||
56-
github.actor.belongs_to_organization ||
57-
github.event.pull_request.merged == true
64+
github.actor == github.repository_owner
5865
}}
5966
permissions:
6067
id-token: write
@@ -89,14 +96,8 @@ jobs:
8996
TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-fse-${{ matrix.release }}-artifact
9097
UPLOAD_BUILD_ARTIFACTS: >-
9198
${{
92-
(github.event.pull_request.head.repo.full_name == github.repository) &&
93-
(
94-
(
95-
github.event_name != 'pull_request' &&
96-
github.event_name != 'workflow_dispatch'
97-
) ||
98-
(github.event_name == 'workflow_dispatch' && inputs.publish)
99-
)
99+
(github.event_name == 'push') ||
100+
(github.event_name == 'workflow_dispatch' && inputs.publish)
100101
}}
101102
secrets:
102103
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}
@@ -144,14 +145,8 @@ jobs:
144145
TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-${{ matrix.release }}-artifact
145146
UPLOAD_BUILD_ARTIFACTS: >-
146147
${{
147-
(github.event.pull_request.head.repo.full_name == github.repository) &&
148-
(
149-
(
150-
github.event_name != 'pull_request' &&
151-
github.event_name != 'workflow_dispatch'
152-
) ||
153-
(github.event_name == 'workflow_dispatch' && inputs.publish)
154-
)
148+
(github.event_name == 'push') ||
149+
(github.event_name == 'workflow_dispatch' && inputs.publish)
155150
}}
156151
secrets:
157152
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}

0 commit comments

Comments
 (0)