diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 86d89b960..a80f32c56 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -71,25 +71,25 @@ jobs: ruby --version pwd gem install dotenv json octokit tmpdir fileutils - # - name: Get PR details - # if: github.event_name == 'workflow_dispatch' - # id: pr_details - # uses: actions/github-script@v6 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # script: | - # const pr_id = parseInt(${{ github.event.inputs.pr_id }}); - # echo "pr_id is ${{ github.event.inputs.pr_id }}" - # await (async () => { - # const { data: pr } = await github.rest.pulls.get({ - # owner: 'esrlabs', - # repo: 'chipmunk', - # pull_number: pr_id, - # }); - # })(); - # core.setOutput('owner', pr.head.repo.owner.login); - # core.setOutput('repo', pr.head.repo.name); + - name: Get PR details + if: github.event_name == 'workflow_dispatch' + id: pr_details + uses: actions/github-script@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + script: | + const pr_id = parseInt(${{ github.event.inputs.pr_id }}); + echo "pr_id is ${{ github.event.inputs.pr_id }}" + await (async () => { + const { data: pr } = await github.rest.pulls.get({ + owner: 'esrlabs', + repo: 'chipmunk', + pull_number: pr_id, + }); + })(); + core.setOutput('owner', pr.head.repo.owner.login); + core.setOutput('repo', pr.head.repo.name); - name: Get PR details if: github.event_name == 'workflow_dispatch' id: pr_details_1 @@ -98,7 +98,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: script: | - github.pulls.get({ + github.rest.pulls.get({ owner: 'esrlabs', repo: 'chipmunk', pull_number: pr_id @@ -166,4 +166,4 @@ jobs: git remote set-url origin "https://esrlabs:${{secrets.DOCS_PUSH_TOKEN}}@github.com/esrlabs/chipmunk-docs" git add ./jekyll/benchmarks/data/pull_request/Benchmark_PR_${{ github.event.inputs.pr_id }}.json git commit -m "Adding PR benchmark results for chipmunk PR # ${{ github.event.inputs.pr_id }}" - git push origin master \ No newline at end of file + git push origin master