File tree 3 files changed +12
-5
lines changed
3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 6
6
type :
7
7
description : Type of setup, `minimal` will only run the JavaScript installation.
8
8
required : false
9
+ workflow_name :
10
+ description : Name of the workflow that is executing this action.
11
+ required : false
9
12
10
13
runs :
11
14
using : composite
44
47
shell : bash
45
48
run : |
46
49
previousCommit=${{ github.event.before }}
47
- baseRef=${{ github.base_ref }}
50
+ baseRef=${{ inputs.workflow_name == 'process-release' && 'main' || github.base_ref }}
48
51
origin=$( [[ -z $baseRef ]] && echo $previousCommit || echo "origin/$baseRef" )
49
52
50
53
yarn workspace scripts setRunVariables "$origin"
Original file line number Diff line number Diff line change 19
19
- name : Setup
20
20
id : setup
21
21
uses : ./.github/actions/setup
22
+ with :
23
+ workflow_name : process-release
22
24
23
25
- run : yarn workspace scripts processRelease
24
26
env :
Original file line number Diff line number Diff line change @@ -109,11 +109,13 @@ async function setRunVariables({
109
109
}
110
110
111
111
if ( require . main === module ) {
112
- const [ origin ] = process . argv . slice ( 2 ) ;
112
+ const [ originBranch ] = process . argv . slice ( 2 ) ;
113
113
114
- if ( ! origin ) {
115
- throw new Error ( `Unable to retrieve the origin: ${ origin } ` ) ;
114
+ if ( ! originBranch ) {
115
+ throw new Error (
116
+ `Unable to retrieve the origin branch: ${ JSON . stringify ( originBranch ) } `
117
+ ) ;
116
118
}
117
119
118
- setRunVariables ( { originBranch : origin } ) ;
120
+ setRunVariables ( { originBranch } ) ;
119
121
}
You can’t perform that action at this time.
0 commit comments