Skip to content

Commit 0cc6d74

Browse files
authored
Merge pull request #3263 from pyrevitlabs/develop
pre release: fix main.yml
2 parents bd2f52e + e4730e8 commit 0cc6d74

File tree

86 files changed

+489
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+489
-95
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ on:
1313
- 'pyrevitlib/**'
1414
- 'release/**'
1515
- 'site-packages/**'
16+
# After merges (especially from forks), secrets are available on push but not on pull_request.
17+
push:
18+
branches:
19+
- develop
20+
- master
21+
paths:
22+
- 'bin/**'
23+
- 'dev/**'
24+
- 'extensions/**'
25+
- 'pyrevitlib/**'
26+
- 'release/**'
27+
- 'site-packages/**'
1628
workflow_dispatch:
1729

1830
env:
@@ -127,9 +139,30 @@ jobs:
127139
uses: juliangruber/read-file-action@v1
128140
with:
129141
path: release/version
142+
143+
# Secrets are not available for pull_request workflows from forks; skip signing there (push run will sign).
144+
- name: Require Trusted Signing secrets
145+
if: >
146+
github.repository == env.MainRepo &&
147+
(github.event_name != 'pull_request' ||
148+
github.event.pull_request.head.repo.full_name == github.repository) &&
149+
(env.WipRun == 'true' || env.ReleaseRun == 'true' ||
150+
github.event_name == 'workflow_dispatch' ||
151+
github.event_name == 'push')
152+
shell: pwsh
153+
run: |
154+
if (-not "${{ secrets.AZURE_ENDPOINT }}") { throw "Missing secret: AZURE_ENDPOINT" }
155+
if (-not "${{ secrets.AZURE_TENANT_ID }}") { throw "Missing secret: AZURE_TENANT_ID" }
156+
if (-not "${{ secrets.AZURE_CLIENT_ID }}") { throw "Missing secret: AZURE_CLIENT_ID" }
157+
if (-not "${{ secrets.AZURE_CLIENT_SECRET }}") { throw "Missing secret: AZURE_CLIENT_SECRET" }
158+
if (-not "${{ secrets.AZURE_CODE_SIGNING_NAME }}") { throw "Missing secret: AZURE_CODE_SIGNING_NAME" }
159+
if (-not "${{ secrets.AZURE_CERT_PROFILE_NAME }}") { throw "Missing secret: AZURE_CERT_PROFILE_NAME" }
130160
131161
- name: Sign files with Trusted Signing (DLLs and EXEs)
132-
if: (github.repository == env.MainRepo)
162+
if: >
163+
github.repository == env.MainRepo &&
164+
(github.event_name != 'pull_request' ||
165+
github.event.pull_request.head.repo.full_name == github.repository)
133166
uses: azure/trusted-signing-action@v1.2.0
134167
with:
135168
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
@@ -151,7 +184,10 @@ jobs:
151184
pipenv run pyrevit build installers
152185
153186
- name: Sign files with Trusted Signing (installers)
154-
if: (github.repository == env.MainRepo)
187+
if: >
188+
github.repository == env.MainRepo &&
189+
(github.event_name != 'pull_request' ||
190+
github.event.pull_request.head.repo.full_name == github.repository)
155191
uses: azure/trusted-signing-action@v1.2.0
156192
with:
157193
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
9.5 KB
Binary file not shown.
9 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
9.5 KB
Binary file not shown.
9 KB
Binary file not shown.

0 commit comments

Comments
 (0)