diff --git a/.github/workflows/PR-Demo-Comment-with-react.yml b/.github/workflows/PR-Demo-Comment-with-react.yml index ff653ad15..51949b6cc 100644 --- a/.github/workflows/PR-Demo-Comment-with-react.yml +++ b/.github/workflows/PR-Demo-Comment-with-react.yml @@ -33,8 +33,6 @@ jobs: ) outputs: pr_number: ${{ steps.get-pr.outputs.pr_number }} - pr_repository: ${{ steps.get-pr-info.outputs.repository }} - pr_ref: ${{ steps.get-pr-info.outputs.ref }} comment_id: ${{ github.event.comment.id }} disable_security: ${{ steps.check-security-flag.outputs.disable_security }} enable_pro: ${{ steps.check-pro-flag.outputs.enable_pro }} @@ -66,29 +64,6 @@ jobs: console.log(`PR Number: ${prNumber}`); core.setOutput('pr_number', prNumber); - - name: Get PR repository and ref - id: get-pr-info - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - script: | - const { owner, repo } = context.repo; - const prNumber = context.payload.issue.number; - - const { data: pr } = await github.rest.pulls.get({ - owner, - repo, - pull_number: prNumber, - }); - - // For forks, use the full repository name, for internal PRs use the current repo - const repository = pr.head.repo.fork ? pr.head.repo.full_name : `${owner}/${repo}`; - - console.log(`PR Repository: ${repository}`); - console.log(`PR Branch: ${pr.head.ref}`); - - core.setOutput('repository', repository); - core.setOutput('ref', pr.head.ref); - - name: Check for security/login flag id: check-security-flag env: @@ -171,8 +146,7 @@ jobs: - name: Checkout PR uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: - repository: ${{ needs.check-comment.outputs.pr_repository }} - ref: ${{ needs.check-comment.outputs.pr_ref }} + ref: refs/pull/${{ needs.check-comment.outputs.pr_number }}/merge token: ${{ steps.setup-bot.outputs.token }} - name: Set up JDK