File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,18 @@ def ref
19
19
20
20
pr = Octokit . pull_request ( input [ 'source' ] [ 'repo' ] , input [ 'version' ] [ 'pr' ] )
21
21
id = pr [ 'number' ]
22
- branch_ref = pr [ 'head' ] [ 'sha ' ]
22
+ branch_ref = pr [ 'head' ] [ 'ref ' ]
23
23
24
24
system ( "git clone --depth 1 #{ uri } #{ destination } 1>&2" )
25
25
26
26
raise 'git clone failed' unless $CHILD_STATUS. exitstatus == 0
27
27
28
28
Dir . chdir ( destination ) do
29
- system ( "git fetch -q origin pull/#{ id } /head:#{ branch_ref } 1>&2" )
30
- system ( "git checkout #{ branch_ref } 1>&2" )
29
+ system ( "git fetch -q origin pull/#{ id } /head:pr_temp_branch 1>&2" )
30
+ system ( "git checkout pr_temp_branch 1>&2" )
31
31
system ( "git config --add pullrequest.url #{ pr [ 'html_url' ] } 1>&2" )
32
32
system ( "git config --add pullrequest.id #{ pr [ 'number' ] } 1>&2" )
33
- system ( "git config --add pullrequest.branch #{ branch_ref } 1>&2" )
33
+ system ( "git config --add pullrequest.branch pr_temp_branch 1>&2" )
34
34
end
35
35
36
36
puts JSON . generate ( version : { ref : ref , pr : id . to_s } ,
Original file line number Diff line number Diff line change @@ -56,13 +56,13 @@ def commit(msg)
56
56
get ( version : { ref : @ref , pr : '1' } , source : { uri : git_uri , repo : 'jtarchie/test' } )
57
57
58
58
value = git ( 'rev-parse --abbrev-ref HEAD' , dest_dir )
59
- expect ( value ) . to eq 'foo '
59
+ expect ( value ) . to eq 'pr_temp_branch '
60
60
end
61
61
62
62
it 'sets config variable to branch name' do
63
63
get ( version : { ref : @ref , pr : '1' } , source : { uri : git_uri , repo : 'jtarchie/test' } )
64
64
value = git ( 'config pullrequest.branch' , dest_dir )
65
- expect ( value ) . to eq 'foo '
65
+ expect ( value ) . to eq 'pr_temp_branch '
66
66
end
67
67
68
68
context 'when the git clone fails' do
You can’t perform that action at this time.
0 commit comments