File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -6659,7 +6659,10 @@ function run() {
66596659 try {
66606660 const token = core.getInput('token', { required: true });
66616661 const trivyVersion = core.getInput('trivy_version').replace(/^v/, '');
6662- const image = core.getInput('image', { required: true });
6662+ const image = core.getInput('image') || process.env.IMAGE_NAME;
6663+ if (image === undefined || image === '') {
6664+ throw new Error('Please specify scan target image name');
6665+ }
66636666 const trivyOptions = {
66646667 severity: core.getInput('severity').replace(/\s+/g, ''),
66656668 vulnType: core.getInput('vuln_type').replace(/\s+/g, ''),
Original file line number Diff line number Diff line change @@ -9,7 +9,12 @@ async function run() {
99 try {
1010 const token : string = core . getInput ( 'token' , { required : true } )
1111 const trivyVersion : string = core . getInput ( 'trivy_version' ) . replace ( / ^ v / , '' )
12- const image : string = core . getInput ( 'image' , { required : true } )
12+ const image : string | undefined = core . getInput ( 'image' ) || process . env . IMAGE_NAME
13+
14+ if ( image === undefined || image === '' ) {
15+ throw new Error ( 'Please specify scan target image name' )
16+ }
17+
1318 const trivyOptions : TrivyOption = {
1419 severity : core . getInput ( 'severity' ) . replace ( / \s + / g, '' ) ,
1520 vulnType : core . getInput ( 'vuln_type' ) . replace ( / \s + / g, '' ) ,
You can’t perform that action at this time.
0 commit comments