File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,28 @@ jobs:
42
42
if : ${{ startsWith(github.event.comment.body, '@apply-formatting<!--LLVM CODE FORMAT COMMENT:') }}
43
43
runs-on : ubuntu-latest
44
44
steps :
45
-
45
+ - uses : actions/github-script@v3
46
+ id : get-pr
47
+ with :
48
+ script : |
49
+ const request = {
50
+ owner: context.repo.owner,
51
+ repo: context.repo.repo,
52
+ pull_number: context.issue.number
53
+ }
54
+ core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`)
55
+ try {
56
+ const result = await github.pulls.get(request)
57
+ return result.data
58
+ } catch (err) {
59
+ core.setFailed(`Request failed with error ${err}`)
60
+ }
46
61
- name : Fetch LLVM sources
47
62
uses : actions/checkout@v4
48
63
with :
49
64
fetch-depth : 2
50
- ref : ${{ github.event.pull_request .head.ref }}
51
- repository : ${{ github.event.pull_request .head.repo.full_name }}
65
+ ref : ${{ fromJSON(steps.get-pr.outputs.result) .head.ref }}
66
+ repository : ${{ fromJSON(steps.get-pr.outputs.result) .head.repo.full_name }}
52
67
53
68
- name : Setup Python env
54
69
uses : actions/setup-python@v4
72
87
- name : Commit & Push changes
73
88
uses : actions-js/push@master
74
89
with :
75
- branch : test21
76
- repository : ${{ github.event.pull_request .head.repo.full_name }}
90
+ branch : ${{ fromJSON(steps.get-pr.outputs.result).head.ref }}
91
+ repository : ${{ fromJSON(steps.get-pr.outputs.result) .head.repo.full_name }}
77
92
github_token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments