Skip to content

Commit 1e6af2f

Browse files
committed
deploy: allow deploying in forks
It would be nice if we could deploy the Azure Function contingent on the presence of the `AZURE_RBAC_CREDENTIALS` secret. However, this is not possible in GitHub workflows: the job-level `if:` conditions lack access to the `secrets` context. Strangely enough, they _do_ have access to the `vars` context... So let's allow deploying in forks by requiring both the `AZURE_RBAC_CREDENTIALS` secret as well as a repository _variable_ called `DEPLOY_TO_AZURE` that needs to be set to `true`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 6278cc7 commit 1e6af2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
deploy:
14-
if: github.event.repository.fork == false
14+
if: github.event.repository.fork == false || vars.DEPLOY_TO_AZURE == 'true'
1515
environment: deploy-to-azure
1616
runs-on: ubuntu-latest
1717
steps:

0 commit comments

Comments
 (0)