Browse Source

CLDC-4236: add manual worflow dispatch method back in

pull/3216/head
Nat Dean-Lewis 2 months ago
parent
commit
7c7cf75960
  1. 12
      .github/workflows/review_pipeline.yml

12
.github/workflows/review_pipeline.yml

@ -3,13 +3,19 @@ name: Review app pipeline
on: on:
issue_comment: issue_comment:
types: [created] types: [created]
workflow_dispatch:
inputs:
pull_request_id:
required: true
type: string
description: "The pull request ID to deploy a review app for."
permissions: {} permissions: {}
jobs: jobs:
get_pr_details: get_pr_details:
name: Get PR details name: Get PR details
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/deploy-review') if: github.event_name == 'workflow_dispatch' || (github.event.issue.pull_request && startsWith(github.event.comment.body, '/deploy-review'))
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
pr_number: ${{ steps.get_pr_details.outputs.pr_number }} pr_number: ${{ steps.get_pr_details.outputs.pr_number }}
@ -19,7 +25,11 @@ jobs:
uses: actions/github-script@v7 uses: actions/github-script@v7
with: with:
script: | script: |
if (context.eventName === 'workflow_dispatch') {
core.setOutput('pr_number', '${{ inputs.pull_request_id }}');
} else {
core.setOutput('pr_number', context.issue.number.toString()); core.setOutput('pr_number', context.issue.number.toString());
}
infra: infra:
name: Deploy review app infrastructure name: Deploy review app infrastructure

Loading…
Cancel
Save