Skip to content

Commit

Permalink
fix: incorrect references of pr in issue created event
Browse files Browse the repository at this point in the history
  • Loading branch information
gitcommitshow committed Jun 22, 2024
1 parent 9e32e9d commit 394fef8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ app.octokit.log.debug(`Authenticated as '${data.name}'`);
// Subscribe to the "pull_request.opened" webhook event
app.webhooks.on("pull_request.opened", async ({ octokit, payload }) => {
console.log(
`Received a pull request event for #${payload.pull_request.number}`,
`Received a pull request event for #${payload.pull_request.number} by ${payload.pull_request.user.type}: ${payload.pull_request.user.login}`,
);
try {
if (!isCLARequired(payload.pull_request)) {
Expand Down Expand Up @@ -129,9 +129,7 @@ app.webhooks.on("pull_request.closed", async ({ octokit, payload }) => {
});

app.webhooks.on("issues.opened", async ({ octokit, payload }) => {
console.log(
`Received a new issue event for #${payload.issue.number} by ${pull_request.user.type}: ${pull_request.user.login}`,
);
console.log(`Received a new issue event for #${payload.issue.number}`);
try {
await octokit.rest.issues.createComment({
owner: payload.repository.owner.login,
Expand Down

0 comments on commit 394fef8

Please sign in to comment.