Skip to content

Commit 9cf8057

Browse files
committed
chore: harden the production condition to prevent incorrect deployment
1 parent bb0e536 commit 9cf8057

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
if: github.event_name == 'push' || (github.event.action != 'closed' && github.event.action != 'labeled')
1414
uses: ./.github/workflows/ovh.yaml
1515
with:
16-
environment_name: ${{ github.event_name == 'push' && 'production' || format('pull/{0}', github.event.pull_request.number) }}
17-
url: ${{ github.event_name == 'pull_request_target' && format('https://{0}/pr/{1}', vars.PREVIEW_WEBSITE, github.event.pull_request.number) || format('https://{0}', vars.MAIN_WEBSITE) }}
18-
target: ${{ github.event_name == 'pull_request_target' && format('pulls/pr/{0}', github.event.pull_request.number) || 'www' }}
16+
environment_name: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && 'production' || format('pull/{0}', github.event.pull_request.number) }}
17+
url: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && 'production' && format('https://{0}', vars.MAIN_WEBSITE) || format('https://{0}/pr/{1}', vars.PREVIEW_WEBSITE, github.event.pull_request.number) }}
18+
target: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && 'production' && 'www' || format('pulls/pr/{0}', github.event.pull_request.number) }}
1919
action: deploy
2020
secrets: inherit
2121

0 commit comments

Comments
 (0)