Skip to content

Commit f73d351

Browse files
authored
Action bug fixes (#6336)
1 parent 5f43d5f commit f73d351

File tree

4 files changed

+38
-25
lines changed

4 files changed

+38
-25
lines changed

.github/actions/StaleCloser/StaleCloser.js

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/StaleCloser/StaleCloser.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,19 @@ export class StaleCloser extends ActionBase {
5555
if (
5656
!lastComment ||
5757
lastComment.author.isGitHubApp ||
58+
pingTimestamp == undefined ||
5859
// TODO: List the collaborators once per go rather than checking a single user each issue
59-
(pingTimestamp != undefined &&
60-
(this.additionalTeam.includes(lastComment.author.name) ||
61-
(await issue.hasWriteAccess(lastComment.author))))
60+
this.additionalTeam.includes(lastComment.author.name) ||
61+
await issue.hasWriteAccess(lastComment.author)
6262
) {
63-
if (lastComment) {
64-
console.log(
65-
`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Closing.`,
66-
)
67-
} else {
68-
console.log(`No comments on issue ${hydrated.number}. Closing.`)
63+
if (pingTimestamp != undefined) {
64+
if (lastComment) {
65+
console.log(
66+
`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Closing.`,
67+
)
68+
} else {
69+
console.log(`No comments on issue ${hydrated.number}. Closing.`)
70+
}
6971
}
7072
if (this.closeComment) {
7173
console.log(`Posting comment on issue ${hydrated.number}`)
@@ -93,7 +95,7 @@ export class StaleCloser extends ActionBase {
9395
await issue.setMilestone(+this.setMilestoneId)
9496
}
9597
console.log(`Closing issue ${hydrated.number}.`)
96-
} else if (pingTimestamp != undefined) {
98+
} else {
9799
// Ping
98100
if (hydrated.updatedAt < pingTimestamp && hydrated.assignee) {
99101
console.log(

.github/actions/common/ActionBase.js

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/common/ActionBase.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ export class ActionBase {
4141
// The ID is used for comparisons with issue data, which does not include the name.
4242
// TODO: Figure out a way to convert either from milestone name to ID, or vice versa.
4343

44-
// If inclusion and exclusion are mixed, exclusion will take precedence.
44+
// If label inclusion and exclusion are mixed, exclusion will take precedence.
4545
// For example, an issue with both labels A and B will not match if B is excluded, even if A is included.
4646

47+
// If a milestoneName/milestoneId are set, ignoreMilenameName/ignoreMilestoneIds are ignored.
48+
4749
// GitHub does not appear to support searching for all issues with milestones (not lacking a milestone). "-no:milestone" does not work.
4850
// GitHub does not appear to support searching for all issues with labels (not lacking a label). "-no:label" does not work.
4951

@@ -71,8 +73,11 @@ export class ActionBase {
7173
}
7274
}
7375

74-
if (this.ignoreMilestoneNames) {
75-
if (this.ignoreMilestoneNames == "*" && !this.milestoneName) { // only if no milestone
76+
if (this.milestoneName) {
77+
query = query.concat(` milestone:"${this.milestoneName}"`)
78+
}
79+
else if (this.ignoreMilestoneNames) {
80+
if (this.ignoreMilestoneNames == "*") {
7681
query = query.concat(` no:milestone`)
7782
this.ignoreAllWithMilestones = true;
7883
} else if (this.ignoreMilestoneIds) {

0 commit comments

Comments
 (0)