Skip to content

Commit

Permalink
fix(app): update github imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mrako committed Nov 22, 2021
1 parent af57762 commit ed2fa9e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
28 changes: 22 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ const resolver_1 = __nccwpck_require__(7409);

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
Expand All @@ -66,12 +85,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.resolveRefs = void 0;
const github_1 = __importDefault(__nccwpck_require__(5438));
const github = __importStar(__nccwpck_require__(5438));
const ISSUE_TYPES = ['issue_comment'];
const getPrUrl = (context) => {
if (ISSUE_TYPES.includes(context.eventName)) {
Expand All @@ -80,8 +96,8 @@ const getPrUrl = (context) => {
throw new Error(`Unsupported event type: ${context.eventName}`);
};
const resolveRefs = (token) => __awaiter(void 0, void 0, void 0, function* () {
const prUrl = getPrUrl(github_1.default.context);
const octokit = github_1.default.getOctokit(token);
const prUrl = getPrUrl(github.context);
const octokit = github.getOctokit(token);
const prDetails = yield octokit.request(`GET ${prUrl}`);
const status = prDetails.status;
const headRef = prDetails.data.head.ref;
Expand Down
2 changes: 1 addition & 1 deletion src/resolver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import github from '@actions/github';
import * as github from '@actions/github';

const ISSUE_TYPES = ['issue_comment'];

Expand Down

0 comments on commit ed2fa9e

Please sign in to comment.