Files
azuredatastudio/build/actions/copycat/copyCat.ts
Anthony Dresser 9ac9872533 Refactor github actions and add copycat (#10215)
* add actions

* disable copycat, fix action location

* dont look for env for token
2020-04-29 19:34:02 -07:00

22 lines
781 B
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { GitHubIssue } from '../api/api'
export class CopyCat {
constructor(private github: GitHubIssue, private owner: string, private repo: string) {}
async run() {
const issue = await this.github.getIssue()
console.log(`Mirroring issue \`${issue.title}\` to ${this.owner}/${this.repo}`)
await this.github.createIssue(
this.owner,
this.repo,
issue.title,
issue.body.replace(/@|#|issues/g, '-'),
)
}
}