File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 1919 runs-on : ubuntu-latest
2020
2121 steps :
22- - name : Checkout repository with full history
23- uses : actions/checkout@v4
22+ - name : Get PR info
23+ id : pr
24+ uses : actions/github-script@v7
2425 with :
26+ github-token : ${{ secrets.GITHUB_TOKEN }}
27+ script : |
28+ const prNumber = context.issue.number;
29+ const pr = await github.rest.pulls.get({
30+ owner: context.repo.owner,
31+ repo: context.repo.repo,
32+ pull_number: prNumber,
33+ });
34+
35+ core.info(`Base: ${pr.data.base.repo.full_name}@${pr.data.base.ref}`);
36+ core.info(`Head: ${pr.data.head.repo.full_name}@${pr.data.head.ref}`);
37+
38+ core.setOutput('head_ref', pr.data.head.ref);
39+ core.setOutput('head_repo', pr.data.head.repo.full_name);
40+
41+ - name : Checkout PR head with full history
42+ uses : actions/checkout@v5
43+ with :
44+ repository : ${{ steps.pr.outputs.head_repo }}
45+ ref : ${{ steps.pr.outputs.head_ref }}
2546 fetch-depth : 0
2647 fetch-tags : true
2748
You can’t perform that action at this time.
0 commit comments