File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ inputs:
2828 required : false
2929 description : ' Use @actions/cache to accelerate this Action'
3030 default : ' true'
31+ reasonFilter :
32+ required : false
33+ description : ' Filter results by the reason for the build; Defaults to "all"'
34+ default : ' all'
3135runs :
3236 using : ' node12'
3337 main : ' dist/index.js'
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ async function run(): Promise<void> {
1515 core . getInput ( 'repository' ) ,
1616 core . getInput ( 'definitionId' ) ,
1717 core . getInput ( 'artifact' ) ,
18- core . getInput ( 'stripPrefix' )
18+ core . getInput ( 'stripPrefix' ) ,
19+ core . getInput ( 'reasonFilter' )
1920 )
2021 const outputDirectory = core . getInput ( 'path' ) || artifactName
2122 let useCache = core . getInput ( 'cache' ) === 'true'
Original file line number Diff line number Diff line change @@ -115,7 +115,8 @@ export async function get(
115115 repository : string ,
116116 definitionId : string ,
117117 artifactName : string ,
118- stripPrefix ?: string
118+ stripPrefix ?: string ,
119+ reasonFilter = 'all'
119120) : Promise < {
120121 artifactName : string
121122 stripPrefix : string
@@ -137,7 +138,7 @@ export async function get(
137138 count : number
138139 value : [ { id : string ; downloadURL : string } ]
139140 } > (
140- `${ baseURL } ?definitions=${ definitionId } &statusFilter=completed&resultFilter=succeeded&$top=1`
141+ `${ baseURL } ?definitions=${ definitionId } &statusFilter=completed&resultFilter=succeeded&reasonFilter= ${ reasonFilter } & $top=1`
141142 )
142143 if ( data . count !== 1 ) {
143144 throw new Error ( `Unexpected number of builds: ${ data . count } ` )
You can’t perform that action at this time.
0 commit comments