Remove copycat action (#15172)

This commit is contained in:
Charles Gagnon
2021-04-16 12:45:22 -07:00
committed by GitHub
parent 6d95b113d5
commit ca701a7985
7 changed files with 0 additions and 132 deletions

5
.github/copycat.yml vendored
View File

@@ -1,5 +0,0 @@
{
perform: false,
target_owner: 'anthonydresser',
target_repo: 'testissues'
}

View File

@@ -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

View File

@@ -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'

View File

@@ -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;

View File

@@ -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, '-'),
)
}
}

View File

@@ -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);
});

View File

@@ -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)
})