From a80ee928f63680d4e36faff04bade2f33540295b Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Wed, 27 Sep 2023 10:49:54 +0000 Subject: [PATCH] fix body Signed-off-by: Kawika Avilla --- .github/workflows/cypress_workflow.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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 }}"