feat: revise handling of team reviewers

This commit is contained in:
Peter Evans 2023-04-03 11:31:13 +09:00
parent 91b6c0aa50
commit 1c9f3a221f
5 changed files with 53 additions and 20 deletions

View file

@ -16,6 +16,16 @@ export function getStringAsArray(str: string): string[] {
.filter(x => x !== '')
}
export function stripOrgPrefixFromTeams(teams: string[]): string[] {
return teams.map(team => {
const slashIndex = team.lastIndexOf('/')
if (slashIndex > 0) {
return team.substring(slashIndex + 1)
}
return team
})
}
export function getRepoPath(relativePath?: string): string {
let githubWorkspacePath = process.env['GITHUB_WORKSPACE']
if (!githubWorkspacePath) {