Approve Screenshots #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Approve Screenshots | |
| on: | |
| issue_comment: | |
| types: [created] | |
| workflow_dispatch: | |
| inputs: | |
| pull-request-number: | |
| description: 'Pull Request Number to update screenshots for' | |
| required: true | |
| type: number | |
| jobs: | |
| ## Comment-trigger Workflow ## | |
| check-comment: | |
| name: Check Comment | |
| runs-on: ubuntu-latest | |
| if: github.event.issue.pull_request && contains(github.event.comment.body, '/approve-screenshots') | |
| outputs: | |
| should-run: ${{ steps.check.outputs.should-run }} | |
| pr-number: ${{ steps.check.outputs.pr-number }} | |
| steps: | |
| - name: Check if comment should trigger workflow | |
| id: check | |
| run: | | |
| echo "should-run=true" >> $GITHUB_OUTPUT | |
| echo "pr-number=${{ github.event.issue.number }}" >> $GITHUB_OUTPUT | |
| update-screenshots-comment: | |
| name: Update Screenshots (from comment) | |
| needs: check-comment | |
| if: needs.check-comment.outputs.should-run == 'true' | |
| uses: ./.github/workflows/.e2e.yml | |
| secrets: inherit | |
| with: | |
| frontend-url: https://pay-transparency-pr-${{ needs.check-comment.outputs.pr-number }}-frontend.apps.silver.devops.gov.bc.ca | |
| external-api-base-url: https://pay-transparency-pr-${{ needs.check-comment.outputs.pr-number }}-backend-external.apps.silver.devops.gov.bc.ca | |
| environment: dev | |
| update-screenshots: true | |
| refresh-dev-sandbox-comment: | |
| name: Refresh Dev Sandbox (from comment) | |
| needs: ["check-comment","update-screenshots-comment"] | |
| if: needs.check-comment.outputs.should-run == 'true' | |
| uses: ./.github/workflows/ci_cd_on_pr_dev_sandbox.yml | |
| secrets: inherit | |
| with: | |
| pr-number: ${{ needs.check-comment.outputs.pr-number }} | |
| run-number: ${{ github.run_number }} | |
| ## Manual-trigger Workflow ## | |
| update-screenshots-manual: | |
| name: Update Screenshots (manual) | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: ./.github/workflows/.e2e.yml | |
| secrets: inherit | |
| with: | |
| frontend-url: https://pay-transparency-pr-${{ inputs.pull-request-number }}-frontend.apps.silver.devops.gov.bc.ca | |
| external-api-base-url: https://pay-transparency-pr-${{ inputs.pull-request-number }}-backend-external.apps.silver.devops.gov.bc.ca | |
| environment: dev | |
| update-screenshots: true | |
| refresh-dev-sandbox-manual: | |
| name: Refresh Dev Sandbox (manual) | |
| needs: update-screenshots-manual | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: ./.github/workflows/ci_cd_on_pr_dev_sandbox.yml | |
| secrets: inherit | |
| with: | |
| pr-number: ${{ inputs.pull-request-number }} | |
| run-number: ${{ github.run_number }} |