From 3cb144ede59da0df6afec59a10b0efb3225ff20c Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Wed, 27 Sep 2023 10:23:28 +0000 Subject: [PATCH] use json Signed-off-by: Kawika Avilla --- .github/workflows/cypress_workflow.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cypress_workflow.yml b/.github/workflows/cypress_workflow.yml index 289b0173f925..58062b378ec9 100644 --- a/.github/workflows/cypress_workflow.yml +++ b/.github/workflows/cypress_workflow.yml @@ -56,24 +56,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 }} }); - 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=${{ fromJSON(steps.get_pr_info.outputs.result.head.repo.full_name) }}" >> $GITHUB_ENV + echo "SOURCE_BRANCH=${{ fromJSON(steps.get_pr_info.outputs.result.head.ref) }}" >> $GITHUB_ENV - name: Find Comment uses: peter-evans/find-comment@v2