diff --git a/.github/workflows/cypress_workflow.yml b/.github/workflows/cypress_workflow.yml index 6e180196f393..06c5e481fd02 100644 --- a/.github/workflows/cypress_workflow.yml +++ b/.github/workflows/cypress_workflow.yml @@ -115,24 +115,18 @@ jobs: id: get_pr_info uses: actions/github-script@v6 with: - result-encoding: string script: | - const { data: pr } = await github.rest.pulls.get({ + await github.rest.pulls.get({ owner: context.repo.owner, repo: context.repo.repo, - pull_number: "${{ inputs.pr_number }}" + pull_number: ${{ inputs.pr_number }} }); - const sourceRepo = pr.head.repo.full_name; - const sourceBranch = pr.head.ref; - const sourceJSON = `{ 'source': { 'repo': '${sourceRepo}', 'branch': '${sourceBranch}' } }`; - return sourceJSON; - - name: Set source branch from PR number if: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number != '' }} run: | - echo "SOURCE_REPO=${{ fromJSON(steps.get_pr_info.outputs.result.source.repo) }}" >> $GITHUB_ENV - echo "SOURCE_BRANCH=${{ fromJSON(steps.get_pr_info.outputs.result.source.branch) }}" >> $GITHUB_ENV + echo "SOURCE_REPO=${{ steps.get_pr_info.outputs.result.head.repo.full_name }}" >> $GITHUB_ENV + echo "SOURCE_BRANCH=${{ steps.get_pr_info.outputs.result.head.ref }}" >> $GITHUB_ENV - run: | echo "Source repo: ${{ env.SOURCE_REPO }}"