Skip to content

Commit

Permalink
Update deploy-preview.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli authored Jul 21, 2024
1 parent 53ab3ed commit 5f803c2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ name: Deploy Preview
# read-write repo token
# access to secrets
on:
workflow_dispatch:
inputs:
prNumber:
required: true
description: Which PR to create a preview for

workflow_run:
workflows: ["CI"]
types:
Expand Down Expand Up @@ -86,12 +92,12 @@ jobs:
# this job gates the others -- if the workflow_run request did not come from a PR,
# exit as early as possible
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
if: github.event.workflow_run.event == 'pull_request' || github.event.inputs.prNumber
outputs:
number: ${{ steps.number.outputs.pr-number }}
number: ${{ steps.number.outputs.pr-number || github.event.inputs.prNumber }}
steps:
- run: echo "${{ toJSON(github.event.workflow_run) }}"
name: "debug workflow_run event"
# - run: echo "${{ toJSON(github.event.workflow_run) }}"
# name: "debug workflow_run event"
- run: echo "${{ github.event.workflow_run.pull_requests[0].number }}"
id: number

Expand Down

0 comments on commit 5f803c2

Please sign in to comment.