Skip to content

Commit

Permalink
log PR user
Browse files Browse the repository at this point in the history
  • Loading branch information
idoco committed Mar 20, 2022
1 parent c715216 commit 2a364e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4007,13 +4007,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const github = __importStar(__webpack_require__(469));
function run() {
var _a;
var _a, _b;
if (github.context.eventName !== "pull_request") {
core.setFailed("emoji validation should only run on pull requests");
return;
}
const pullRequestTitle = ((_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.title) || "";
console.log(`The PR title is ${pullRequestTitle}`);
const pullRequestUser = ((_b = github.context.payload.pull_request) === null || _b === void 0 ? void 0 : _b.user) || {};
console.log(`The PR title is "${pullRequestTitle}"`);
console.log(`The PR user is "${pullRequestUser}"`);
// Regular expression to match strings starting with emoji
const regexExp = /^(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]).*/gi;
if (!regexExp.test(pullRequestTitle)) {
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ function run() {
}

const pullRequestTitle = github.context.payload.pull_request?.title || "";
const pullRequestUser = github.context.payload.pull_request?.user || {};


console.log(`The PR title is "${pullRequestTitle}"`);
console.log(`The PR user is "${pullRequestUser}"`);

// Regular expression to match strings starting with emoji
const regexExp = /^(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]).*/gi;
Expand Down

0 comments on commit 2a364e8

Please sign in to comment.