This commit is contained in:
Bhavya U 2024-10-10 12:41:54 -07:00 коммит произвёл GitHub
Родитель 99f3f1382f
Коммит edb954d5f9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -4,13 +4,13 @@
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const github_1 = require("@actions/github");
const octokit_1 = require("../api/octokit");
const Action_1 = require("../common/Action");
const utils_1 = require("../common/utils");
const Commands_1 = require("./Commands");
const repository = JSON.parse((0, utils_1.getRequiredInput)('repository'));
const hydrate = (comment, issue) => {
const baseQueryString = `https://github.com/${github_1.context.repo.owner}/${github_1.context.repo.repo}/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+`;
const baseQueryString = `https://github.com/${repository.owner.login}/${repository.name}/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+`;
const importantLabels = issue.labels.filter((label) => label !== '*duplicate');
const labelsQueryString = encodeURIComponent(importantLabels.map((label) => `label:"${label}"`).join(' '));
const url = baseQueryString + labelsQueryString;
@ -35,7 +35,6 @@ class CommandsRunner extends Action_1.Action {
const auth = await this.getToken();
const event = (0, utils_1.getRequiredInput)('event');
const issue = JSON.parse((0, utils_1.getRequiredInput)('issue'));
const repository = JSON.parse((0, utils_1.getRequiredInput)('repository'));
const octokitIssue = new octokit_1.OctoKitIssue(auth, { owner: repository.owner.login, repo: repository.name }, { number: issue.number });
if (event === 'issue_comment') {
const commentObject = JSON.parse((0, utils_1.getRequiredInput)('comment'));

Просмотреть файл

@ -3,7 +3,6 @@
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { context } from '@actions/github';
import { PayloadRepository } from '@actions/github/lib/interfaces';
import { Issue } from '../api/api';
import { OctoKitIssue } from '../api/octokit';
@ -11,8 +10,10 @@ import { Action } from '../common/Action';
import { getRequiredInput } from '../common/utils';
import { Commands } from './Commands';
const repository: PayloadRepository = JSON.parse(getRequiredInput('repository'));
const hydrate = (comment: string, issue: Issue) => {
const baseQueryString = `https://github.com/${context.repo.owner}/${context.repo.repo}/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+`;
const baseQueryString = `https://github.com/${repository.owner.login}/${repository.name}/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+`;
const importantLabels = issue.labels.filter((label) => label !== '*duplicate');
const labelsQueryString = encodeURIComponent(
importantLabels.map((label) => `label:"${label}"`).join(' '),
@ -40,7 +41,6 @@ class CommandsRunner extends Action {
const auth = await this.getToken();
const event = getRequiredInput('event');
const issue = JSON.parse(getRequiredInput('issue'));
const repository: PayloadRepository = JSON.parse(getRequiredInput('repository'));
const octokitIssue = new OctoKitIssue(
auth,