1- import * as core from '@actions/core' ;
2- import * as github from '@actions/github' ;
3- import { GithubHelper } from '@workflows/utils' ;
1+ import * as core from '@actions/core'
2+ import * as github from '@actions/github'
3+ import { GithubHelper } from '@workflows/utils'
44
55async function main ( ) : Promise < void > {
6- const repo = core . getInput ( 'repo' ) || github . context . repo . repo ;
7- const owner = core . getInput ( 'owner' ) || github . context . repo . owner ;
8- const token = core . getInput ( 'token' ) || '' ;
9- const dryRun = core . getBooleanInput ( 'dry-run' ) || false ;
10- const label = core . getInput ( 'label' ) ;
11- const version = core . getInput ( 'version' ) ;
6+ const repo = core . getInput ( 'repo' ) || github . context . repo . repo
7+ const owner = core . getInput ( 'owner' ) || github . context . repo . owner
8+ const token = core . getInput ( 'token' ) || ''
9+ const dryRun = core . getBooleanInput ( 'dry-run' ) || false
10+ const label = core . getInput ( 'label' )
11+ const version = core . getInput ( 'version' )
1212
13- core . startGroup ( 'close-release-issue' ) ;
14- core . info ( 'close-release-issue' ) ;
15- core . info ( `repo: ${ repo } ` ) ;
16- core . info ( `owner: ${ owner } ` ) ;
17- core . endGroup ( ) ;
13+ core . startGroup ( 'close-release-issue' )
14+ core . info ( 'close-release-issue' )
15+ core . info ( `repo: ${ repo } ` )
16+ core . info ( `owner: ${ owner } ` )
17+ core . endGroup ( )
1818
1919 const githubHelper = new GithubHelper ( {
2020 owner,
2121 repo,
2222 token,
2323 dryRun,
24- } ) ;
24+ } )
2525 const issues = await githubHelper . getIssueList ( {
2626 state : 'open' ,
27- label
28- } ) ;
29- core . debug ( `issues: ${ JSON . stringify ( issues , null , 2 ) } ` ) ;
27+ label,
28+ } )
29+ core . debug ( `issues: ${ JSON . stringify ( issues , null , 2 ) } ` )
3030
3131 const releaseUrl = `https://github.com/${ owner } /${ repo } /releases/tag/${ version } `
32- const comment = `此问题 [${ version } ](${ releaseUrl } ) 版本已处理发布,请升级版本使用,如有问题请重新新建 issue 进行反馈,谢谢。` ;
32+ const comment = `此问题 [${ version } ](${ releaseUrl } ) 版本已处理发布,请升级版本使用,如有问题请重新新建 issue 进行反馈,谢谢。`
3333 for ( const issue of issues ) {
34- await githubHelper . closeIssue ( issue . number ) ;
35- await githubHelper . addComment ( issue . number , comment ) ;
36-
34+ await githubHelper . closeIssue ( issue . number )
35+ await githubHelper . addComment ( issue . number , comment )
3736 }
3837}
3938
40- main ( ) ;
39+ main ( )
0 commit comments