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
| # Trigger desktop E2E tests when someone comments /e2e-desktop on a PR, or manually. | |
| # Calls the reusable e2e-desktop workflow with the PR head ref. | |
| name: E2E Desktop (Comment Trigger) | |
| on: | |
| issue_comment: | |
| types: [created] | |
| workflow_dispatch: | |
| inputs: | |
| pr: | |
| description: PR number to run E2E on (required for manual run) | |
| required: true | |
| type: number | |
| jobs: | |
| check-trigger: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_run: ${{ steps.check.outputs.should_run }} | |
| steps: | |
| - name: Check comment trigger | |
| id: check | |
| uses: ./.github/actions/check-comment-trigger | |
| with: | |
| trigger: '/e2e-desktop' | |
| allow_workflow_dispatch: 'true' | |
| get-pr-ref: | |
| needs: check-trigger | |
| if: needs.check-trigger.outputs.should_run == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| ref: ${{ steps.pr.outputs.sha }} | |
| steps: | |
| - name: Get PR head ref | |
| id: pr | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const prNumber = context.eventName === 'workflow_dispatch' | |
| ? context.payload.inputs.pr | |
| : context.issue.number; | |
| const pr = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: Number(prNumber), | |
| }); | |
| core.setOutput('sha', pr.data.head.sha); | |
| e2e-desktop: | |
| needs: get-pr-ref | |
| uses: ./.github/workflows/e2e-desktop.yml | |
| with: | |
| ref: ${{ needs.get-pr-ref.outputs.ref }} | |
| secrets: inherit |