File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export class GithubDiscussionClient {
145145 return result . data . repository ?. discussions as DiscussionConnection ;
146146 }
147147
148- public async getAnswerableDiscussionCategoryIDs ( ) : Promise < any > {
148+ public async getAnswerableDiscussionCategoryIDs ( ) : Promise < string [ ] > {
149149 const result = await this . githubClient . query < GetAnswerableDiscussionIdQuery , GetAnswerableDiscussionIdQueryVariables > ( {
150150 query : GetAnswerableDiscussionId ,
151151 variables : {
@@ -166,7 +166,7 @@ export class GithubDiscussionClient {
166166 } )
167167
168168 if ( ! answerableCategoryIDs . length ) {
169- throw new Error ( 'There are no answerable discussion categories in this repository, this GitHub Action only works on answerable discussion categories.' ) ;
169+ core . warning ( 'There are no answerable discussion categories in this repository, this GitHub Action only works on answerable discussion categories.' ) ;
170170 }
171171
172172 return answerableCategoryIDs ;
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ async function main() {
3838
3939export async function processDiscussions ( githubClient : GithubDiscussionClient ) {
4040 const discussionCategoryIDList : string [ ] = await githubClient . getAnswerableDiscussionCategoryIDs ( ) ;
41+ if ( discussionCategoryIDList . length === 0 ) {
42+ core . info ( 'No answerable discussions found. Exiting.' ) ;
43+ return ;
44+ }
4145
4246 for ( const discussionCategoryID of discussionCategoryIDList ) {
4347 let hasNextPage = true ;
You can’t perform that action at this time.
0 commit comments