Skip to content

Commit

Permalink
Upgrade deps (#24)
Browse files Browse the repository at this point in the history
* upgrade deps

* repack
  • Loading branch information
singingwolfboy authored May 31, 2021
1 parent 741f078 commit 743f69d
Show file tree
Hide file tree
Showing 9 changed files with 4,346 additions and 6,853 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"plugin:@typescript-eslint/recommended",
"plugin:github/recommended",
"plugin:jest/recommended",
"prettier/@typescript-eslint"
"prettier"
],
"env": {
"commonjs": true,
Expand Down
624 changes: 424 additions & 200 deletions dist/index.js

Large diffs are not rendered by default.

10,498 changes: 3,883 additions & 6,615 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@
},
"homepage": "https://github.com/singingwolfboy/create-linked-clubhouse-story#readme",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0",
"@actions/http-client": "^1.0.9",
"@octokit/webhooks": "^7.21.0",
"graphql": "^15.4.0",
"mustache": "^4.1.0"
"@actions/core": "^1.3.0",
"@actions/github": "^5.0.0",
"@actions/http-client": "^1.0.11",
"@octokit/webhooks": "^9.6.3",
"graphql": "^15.5.0",
"mustache": "^4.2.0"
},
"devDependencies": {
"@types/jest": "^26.0.19",
"@types/mustache": "^4.1.0",
"@types/node": "^14.14.16",
"@typescript-eslint/eslint-plugin": "^4.11.0",
"@typescript-eslint/parser": "^4.11.0",
"@vercel/ncc": "^0.26.1",
"eslint": "^7.16.0",
"eslint-plugin-github": "^4.1.1",
"eslint-plugin-jest": "^24.1.3",
"jest": "^26.6.3",
"nock": "^13.0.5",
"prettier": "^2.2.1",
"ts-jest": "^26.4.4",
"typescript": "^4.1.3"
"@types/jest": "^26.0.23",
"@types/mustache": "^4.1.1",
"@types/node": "^15.6.1",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"@vercel/ncc": "^0.28.6",
"eslint": "^7.27.0",
"eslint-plugin-github": "^4.1.3",
"eslint-plugin-jest": "^24.3.6",
"jest": "^27.0.3",
"nock": "^13.0.11",
"prettier": "2.3.0",
"ts-jest": "^27.0.2",
"typescript": "^4.3.2"
},
"jest": {
"preset": "ts-jest"
Expand Down
4 changes: 2 additions & 2 deletions src/closed.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from "@actions/core";
import { context } from "@actions/github";
import { EventPayloads } from "@octokit/webhooks";
import { PullRequestClosedEvent } from "@octokit/webhooks-types";
import { HttpClient } from "@actions/http-client";
import {
CLUBHOUSE_STORY_URL_REGEXP,
Expand All @@ -13,7 +13,7 @@ import {
} from "./util";

export default async function closed(): Promise<void> {
const payload = context.payload as EventPayloads.WebhookPayloadPullRequest;
const payload = context.payload as PullRequestClosedEvent;
const branchName = payload.pull_request.head.ref;
let storyId = getClubhouseStoryIdFromBranchName(branchName);
if (storyId) {
Expand Down
4 changes: 2 additions & 2 deletions src/labeled.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from "@actions/core";
import { context } from "@actions/github";
import { EventPayloads } from "@octokit/webhooks";
import { PullRequestLabeledEvent } from "@octokit/webhooks-types";
import { HttpClient } from "@actions/http-client";
import {
getClubhouseStoryIdFromPullRequest,
Expand All @@ -12,7 +12,7 @@ import {
} from "./util";

export default async function labeled(): Promise<void> {
const payload = context.payload as EventPayloads.WebhookPayloadPullRequest;
const payload = context.payload as PullRequestLabeledEvent;

// Do this up front because we want to return fast if the new label was not
// configured for Iteration support
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from "@actions/core";
import { context } from "@actions/github";
import { EventPayloads } from "@octokit/webhooks";
import { PullRequestEvent } from "@octokit/webhooks-types";
import opened from "./opened";
import closed from "./closed";
import labeled from "./labeled";
Expand All @@ -12,7 +12,7 @@ async function run(): Promise<void> {
return;
}

const payload = context.payload as EventPayloads.WebhookPayloadPullRequest;
const payload = context.payload as PullRequestEvent;
const author = payload.pull_request.user.login;

if (!shouldProcessPullRequestForUser(author)) return;
Expand Down
4 changes: 2 additions & 2 deletions src/opened.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from "@actions/core";
import { context } from "@actions/github";
import { EventPayloads } from "@octokit/webhooks";
import { PullRequestOpenedEvent } from "@octokit/webhooks-types";
import { HttpClient } from "@actions/http-client";
import Mustache from "mustache";
import {
Expand All @@ -12,7 +12,7 @@ import {
} from "./util";

export default async function opened(): Promise<void> {
const payload = context.payload as EventPayloads.WebhookPayloadPullRequest;
const payload = context.payload as PullRequestOpenedEvent;
const branchName = payload.pull_request.head.ref;
let storyId = getClubhouseStoryIdFromBranchName(branchName);
if (storyId) {
Expand Down
19 changes: 10 additions & 9 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from "@actions/core";
import * as github from "@actions/github";
import { EventPayloads } from "@octokit/webhooks";
import { PullRequestEvent } from "@octokit/webhooks-types";
import { HttpClient } from "@actions/http-client";
import Mustache from "mustache";
import {
Expand All @@ -14,7 +14,8 @@ import {
ClubhouseIterationSlim,
} from "./types";

export const CLUBHOUSE_STORY_URL_REGEXP = /https:\/\/app.clubhouse.io\/\w+\/story\/(\d+)(\/[A-Za-z0-9-]*)?/;
export const CLUBHOUSE_STORY_URL_REGEXP =
/https:\/\/app.clubhouse.io\/\w+\/story\/(\d+)(\/[A-Za-z0-9-]*)?/;
export const CLUBHOUSE_BRANCH_NAME_REGEXP = /^(?:.+[-/])?ch(\d+)(?:[-/].+)?$/;

interface Stringable {
Expand Down Expand Up @@ -154,7 +155,7 @@ export async function getClubhouseUserId(
});

const octokit = github.getOctokit(GITHUB_TOKEN);
const userResponse = await octokit.users.getByUsername({
const userResponse = await octokit.rest.users.getByUsername({
username: githubUsername,
});
const user = userResponse.data;
Expand Down Expand Up @@ -276,7 +277,7 @@ export async function getClubhouseWorkflowState(
}

export async function createClubhouseStory(
payload: EventPayloads.WebhookPayloadPullRequest,
payload: PullRequestEvent,
http: HttpClient
): Promise<ClubhouseStory | null> {
const CLUBHOUSE_TOKEN = core.getInput("clubhouse-token", { required: true });
Expand Down Expand Up @@ -354,7 +355,7 @@ export function getClubhouseStoryIdFromBranchName(
}

export async function getClubhouseURLFromPullRequest(
payload: EventPayloads.WebhookPayloadPullRequest
payload: PullRequestEvent
): Promise<string | null> {
const GITHUB_TOKEN = core.getInput("github-token", {
required: true,
Expand All @@ -373,7 +374,7 @@ export async function getClubhouseURLFromPullRequest(
repo: payload.repository.name,
issue_number: payload.pull_request.number,
};
const commentsResponse = await octokit.issues.listComments(params);
const commentsResponse = await octokit.rest.issues.listComments(params);
if (commentsResponse.status === 200) {
const commentWithURL = commentsResponse.data.find(
(comment) => comment.body && CLUBHOUSE_STORY_URL_REGEXP.test(comment.body)
Expand All @@ -396,7 +397,7 @@ export async function getClubhouseURLFromPullRequest(
}

export async function getClubhouseStoryIdFromPullRequest(
payload: EventPayloads.WebhookPayloadPullRequest
payload: PullRequestEvent
): Promise<string | null> {
const branchName = payload.pull_request.head.ref;
const storyId = getClubhouseStoryIdFromBranchName(branchName);
Expand All @@ -417,7 +418,7 @@ export async function getClubhouseStoryIdFromPullRequest(
}

export async function addCommentToPullRequest(
payload: EventPayloads.WebhookPayloadPullRequest,
payload: PullRequestEvent,
comment: string
): Promise<boolean> {
const GITHUB_TOKEN = core.getInput("github-token", {
Expand All @@ -431,7 +432,7 @@ export async function addCommentToPullRequest(
issue_number: payload.pull_request.number,
body: comment,
};
const commentResponse = await octokit.issues.createComment(params);
const commentResponse = await octokit.rest.issues.createComment(params);
if (commentResponse.status !== 201) {
core.setFailed(
`HTTP ${
Expand Down

0 comments on commit 743f69d

Please sign in to comment.