@@ -21,23 +21,10 @@ jobs:
21
21
if : (github.event.issue.pull_request) && contains(fromJSON('["/pandas_nightly", "/pyright_strict", "/mypy_nightly"]'), github.event.comment.body)
22
22
23
23
steps :
24
- - uses : actions/checkout@v4
25
-
26
- - name : Install project dependencies
27
- uses : ./.github/setup
28
- with :
29
- os : ubuntu-latest
30
- python-version : " 3.11"
31
-
32
- - name : Run ${{ fromJSON(env.DISPLAY_COMMAND)[github.event.comment.body] }}
33
- # run the tests based on the value of the comment
34
- id : tests-step
35
- run : poetry run poe ${{ fromJSON(env.RUN_COMMAND)[github.event.comment.body] }}
36
-
37
- - name : Get head sha and store value
24
+ - name : Get head sha, branch name and store value
38
25
# get the sha of the last commit to attach the results of the tests
39
26
if : always()
40
- id : get-sha
27
+ id : get-branch-info
41
28
uses : actions/github-script@v7
42
29
with :
43
30
github-token : ${{ secrets.GITHUB_TOKEN }}
48
35
pull_number: ${{ github.event.issue.number }}
49
36
})
50
37
core.setOutput('sha', pr.data.head.sha)
38
+ core.setOutput('branch', pr.data.head.ref)
39
+
40
+ - name : Checkout code on the correct branch
41
+ uses : actions/checkout@v4
42
+ with :
43
+ # context is not aware which branch to checkout so it would otherwise
44
+ # default to main
45
+ ref : ${{ steps.get-branch-info.outputs.branch }}
46
+
47
+ - name : Install project dependencies
48
+ uses : ./.github/setup
49
+ with :
50
+ os : ubuntu-latest
51
+ python-version : " 3.12"
52
+
53
+ - name : Run ${{ fromJSON(env.DISPLAY_COMMAND)[github.event.comment.body] }}
54
+ # run the tests based on the value of the comment
55
+ id : tests-step
56
+ run : poetry run poe ${{ fromJSON(env.RUN_COMMAND)[github.event.comment.body] }}
51
57
52
58
- name : Report results of the tests and publish
53
59
# publish the results to a check run no matter the pass or fail
58
64
script : |
59
65
github.rest.checks.create({
60
66
name: '${{ fromJSON(env.DISPLAY_COMMAND)[github.event.comment.body] }}',
61
- head_sha: '${{ steps.get-sha .outputs.sha }}',
67
+ head_sha: '${{ steps.get-branch-info .outputs.sha }}',
62
68
status: 'completed',
63
69
conclusion: '${{ steps.tests-step.outcome }}',
64
70
output: {
0 commit comments