@@ -81,7 +81,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
81
81
$ github_repo = getenv ('GITHUB_REPOSITORY ' );
82
82
83
83
$ issue_type = getenv ('JIRA_ISSUE_TYPE ' );
84
- $ watchers = explode ("\n" , getenv ('JIRA_WATCHERS ' )) ?? [];
84
+
85
+ $ watchers = [];
86
+ if (is_string (getenv ('JIRA_WATCHERS ' ))) {
87
+ $ watchers = explode ("\n" , getenv ('JIRA_WATCHERS ' )) ?? [];
88
+ }
89
+
85
90
$ res_group = getenv ('JIRA_RESTRICTED_GROUP ' );
86
91
$ res_comment = getenv ('JIRA_RESTRICTED_COMMENT ' );
87
92
@@ -126,7 +131,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
126
131
$ issue ->setField ('restricted_comment ' , $ res_comment ?? []);
127
132
128
133
$ timestamp = gmdate (DATE_ISO8601 );
129
- $ this ->log ($ output , "{$ timestamp } - {$ project } - {$ package }: {$ vulnerableVersionRange } - " );
134
+ $ this ->log ($ output , "{$ timestamp } - {$ jira_project } - {$ package }: {$ vulnerableVersionRange } - " );
130
135
131
136
// Determine whether there is an issue for this alert already.
132
137
try {
@@ -151,7 +156,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
151
156
}
152
157
$ this ->logLine ($ output , "Created issue {$ key }" );
153
158
} else {
154
- $ this ->logLine ($ output , "Would have created an issue in {$ project } if not a dry run. " );
159
+ $ this ->logLine ($ output , "Would have created an issue in {$ jira_project } if not a dry run. " );
155
160
}
156
161
}
157
162
}
0 commit comments