"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); var Context = /** @class */ (function () { function Context() { this.payload = process.env.GITHUB_EVENT_PATH ? require(process.env.GITHUB_EVENT_PATH) : {}; this.event = process.env.GITHUB_EVENT_NAME; this.sha = process.env.GITHUB_SHA; this.ref = process.env.GITHUB_REF; this.workflow = process.env.GITHUB_WORKFLOW; this.action = process.env.GITHUB_ACTION; this.actor = process.env.GITHUB_ACTOR; } Object.defineProperty(Context.prototype, "issue", { get: function () { var payload = this.payload; return __assign({}, this.repo, { number: (payload.issue || payload.pull_request || payload).number }); }, enumerable: true, configurable: true }); Object.defineProperty(Context.prototype, "repo", { get: function () { if (process.env.GITHUB_REPOSITORY) { var _a = process.env.GITHUB_REPOSITORY.split('/'), owner = _a[0], repo = _a[1]; return { owner: owner, repo: repo }; } if (this.payload.repository) { return { owner: this.payload.repository.owner.login, repo: this.payload.repository.name }; } throw new Error('context.repo requires a GITHUB_REPOSITORY environment variable like \'owner/repo\''); }, enumerable: true, configurable: true }); return Context; }()); exports.Context = Context; //# sourceMappingURL=context.js.map