Skip to content

Commit

Permalink
fix reapplying label to issue (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
robandpdx authored Aug 7, 2023
1 parent 41b174f commit a19e3a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module.exports = (app) => {
await context.octokit.rest.issues.addLabels({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
issue_number: context.payload.pull_request.number,
issue_number: context.payload.issue.number,
labels: [emergencyLabel]
}).then(response => {
console.log(`${emergencyLabel} label reapplied to PR: ${context.payload.issue.html_url}`);
Expand Down
4 changes: 1 addition & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ const payloadIssueUnlabeled = {
issue: {
url: "https://api.github.com/repos/robandpdx/superbigmono/issues/1",
html_url: "https://github.com/robandpdx/superbigmono/pull/1",
},
pull_request: {
number: 1,
},
repository: {
Expand Down Expand Up @@ -549,7 +547,7 @@ test("recieves pull_request.unlabeled event, fail to reapply emergency label", a
});

// This test will not reapply the emergency label to a PR
test("recieves pull_request.unlabeled event, dont't emergency label", async function () {
test("recieves pull_request.unlabeled event, don't emergency label", async function () {
delete process.env.EMERGENCY_LABEL_PERMANENT;
process.env.EMERGENCY_LABEL_PERMANENT = 'false';
await probot.receive(payloadUnlabeled);
Expand Down

0 comments on commit a19e3a7

Please sign in to comment.