Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix reapplying label to issue #65

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading