diff --git a/.github/copycat.yml b/.github/copycat.yml deleted file mode 100644 index a4cb3415d1..0000000000 --- a/.github/copycat.yml +++ /dev/null @@ -1,5 +0,0 @@ -{ - perform: false, - target_owner: 'anthonydresser', - target_repo: 'testissues' -} diff --git a/.github/workflows/on-issue-open.yml b/.github/workflows/on-issue-open.yml deleted file mode 100644 index 57b7715224..0000000000 --- a/.github/workflows/on-issue-open.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: On Issue Open -on: - issues: - types: [opened] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@v2.2.0 - with: - repository: 'microsoft/azuredatastudio' - ref: main - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions/build/actions - - - name: Run CopyCat - uses: ./actions/build/actions/copycat - with: - token: ${{secrets.TRIAGE_PAT}} - owner: anthonydresser - repo: testissues diff --git a/build/actions/copycat/action.yml b/build/actions/copycat/action.yml deleted file mode 100644 index 5a83310ef7..0000000000 --- a/build/actions/copycat/action.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Copycat -description: Copy all new issues to a different repo -inputs: - token: - description: GitHub token with issue, comment, and label read/write permissions to both repos - default: ${{ github.token }} - owner: - description: account/organization that owns the destination repo (the microsoft part of microsoft/vscode) - required: true - repo: - description: name of the destination repo (the vscode part of microsoft/vscode) - required: true -runs: - using: 'node12' - main: 'index.js' diff --git a/build/actions/copycat/copyCat.js b/build/actions/copycat/copyCat.js deleted file mode 100644 index 8d0493ebf9..0000000000 --- a/build/actions/copycat/copyCat.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -class CopyCat { - constructor(github, owner, repo) { - this.github = github; - this.owner = owner; - this.repo = repo; - } - 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, '-')); - } -} -exports.CopyCat = CopyCat; diff --git a/build/actions/copycat/copyCat.ts b/build/actions/copycat/copyCat.ts deleted file mode 100644 index 2d2e920c0b..0000000000 --- a/build/actions/copycat/copyCat.ts +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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, '-'), - ) - } -} diff --git a/build/actions/copycat/index.js b/build/actions/copycat/index.js deleted file mode 100644 index 7af0f6db1e..0000000000 --- a/build/actions/copycat/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const core = require("@actions/core"); -const github_1 = require("@actions/github"); -const octokit_1 = require("../api/octokit"); -const utils_1 = require("../utils/utils"); -const copyCat_1 = require("./copyCat"); -const token = utils_1.getRequiredInput('token'); -const main = async () => { - await new copyCat_1.CopyCat(new octokit_1.OctoKitIssue(token, github_1.context.repo, { number: github_1.context.issue.number }), utils_1.getRequiredInput('owner'), utils_1.getRequiredInput('repo')).run(); -}; -main() - .then(() => utils_1.logRateLimit(token)) - .catch(async (error) => { - core.setFailed(error.message); - await utils_1.logErrorToIssue(error.message, true, token); -}); diff --git a/build/actions/copycat/index.ts b/build/actions/copycat/index.ts deleted file mode 100644 index 418e499974..0000000000 --- a/build/actions/copycat/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as core from '@actions/core' -import { context } from '@actions/github' -import { OctoKitIssue } from '../api/octokit' -import { getRequiredInput, logErrorToIssue, logRateLimit } from '../utils/utils' -import { CopyCat } from './copyCat' - -const token = getRequiredInput('token') - -const main = async () => { - await new CopyCat( - new OctoKitIssue(token, context.repo, { number: context.issue.number }), - getRequiredInput('owner'), - getRequiredInput('repo'), - ).run() -} - -main() - .then(() => logRateLimit(token)) - .catch(async (error) => { - core.setFailed(error.message) - await logErrorToIssue(error.message, true, token) - })