workflows: Update stale-issue-bot.yaml to use actions/github-script@v6
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
2f8f99acae
commit
021459e53e
|
@ -36,10 +36,12 @@ jobs:
|
||||||
if: github.repository == 'Klipper3d/klipper'
|
if: github.repository == 'Klipper3d/klipper'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v3
|
- uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const issues = await github.issues.listForRepo({
|
const expireMillis = 1000 * 60 * 60 * 36;
|
||||||
|
const curtime = new Date().getTime();
|
||||||
|
const issues = await github.rest.issues.listForRepo({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
state: 'open',
|
state: 'open',
|
||||||
|
@ -47,13 +49,11 @@ jobs:
|
||||||
per_page: 100,
|
per_page: 100,
|
||||||
page: 1
|
page: 1
|
||||||
});
|
});
|
||||||
const expireMillis = 1000 * 60 * 60 * 36;
|
for (const issue of issues.data.values()) {
|
||||||
const curtime = new Date().getTime();
|
|
||||||
for (var issue of issues.data.values()) {
|
|
||||||
const updatetime = new Date(issue.updated_at).getTime();
|
const updatetime = new Date(issue.updated_at).getTime();
|
||||||
if (curtime < updatetime + expireMillis)
|
if (curtime < updatetime + expireMillis)
|
||||||
continue;
|
continue;
|
||||||
await github.issues.update({
|
await github.rest.issues.update({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
|
@ -148,10 +148,19 @@ jobs:
|
||||||
if: github.repository == 'Klipper3d/klipper'
|
if: github.repository == 'Klipper3d/klipper'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v3
|
- uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const issues = await github.issues.listForRepo({
|
msg = "This ticket is being closed because the underlying issue"
|
||||||
|
+ " is now thought to be resolved."
|
||||||
|
+ "\n\n"
|
||||||
|
+ "Best regards,\n"
|
||||||
|
+ "~ Your friendly GitIssueBot"
|
||||||
|
+ "\n\n"
|
||||||
|
+ "PS: I'm just an automated script, not a human being.";
|
||||||
|
const expireMillis = 1000 * 60 * 60 * 24 * 7;
|
||||||
|
const curtime = new Date().getTime();
|
||||||
|
const issues = await github.rest.issues.listForRepo({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
state: 'open',
|
state: 'open',
|
||||||
|
@ -159,26 +168,17 @@ jobs:
|
||||||
per_page: 100,
|
per_page: 100,
|
||||||
page: 1
|
page: 1
|
||||||
});
|
});
|
||||||
const expireMillis = 1000 * 60 * 60 * 24 * 7;
|
for (const issue of issues.data.values()) {
|
||||||
const curtime = new Date().getTime();
|
|
||||||
for (var issue of issues.data.values()) {
|
|
||||||
const updatetime = new Date(issue.updated_at).getTime();
|
const updatetime = new Date(issue.updated_at).getTime();
|
||||||
if (curtime < updatetime + expireMillis)
|
if (curtime < updatetime + expireMillis)
|
||||||
continue;
|
continue;
|
||||||
msg = "This ticket is being closed because the underlying issue"
|
await github.rest.issues.createComment({
|
||||||
+ " is now thought to be resolved."
|
|
||||||
+ "\n\n"
|
|
||||||
+ "Best regards,\n"
|
|
||||||
+ "~ Your friendly GitIssueBot"
|
|
||||||
+ "\n\n"
|
|
||||||
+ "PS: I'm just an automated script, not a human being.";
|
|
||||||
await github.issues.createComment({
|
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
body: msg
|
body: msg
|
||||||
});
|
});
|
||||||
await github.issues.update({
|
await github.rest.issues.update({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
|
@ -190,10 +190,20 @@ jobs:
|
||||||
if: github.repository == 'Klipper3d/klipper'
|
if: github.repository == 'Klipper3d/klipper'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v3
|
- uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const issues = await github.issues.listForRepo({
|
msg = "This PR is being closed because it is currently not"
|
||||||
|
+ " considered a good match for the master Klipper"
|
||||||
|
+ " repository."
|
||||||
|
+ "\n\n"
|
||||||
|
+ "Best regards,\n"
|
||||||
|
+ "~ Your friendly GitIssueBot"
|
||||||
|
+ "\n\n"
|
||||||
|
+ "PS: I'm just an automated script, not a human being.";
|
||||||
|
const expireMillis = 1000 * 60 * 60 * 24 * 7;
|
||||||
|
const curtime = new Date().getTime();
|
||||||
|
const issues = await github.rest.issues.listForRepo({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
state: 'open',
|
state: 'open',
|
||||||
|
@ -201,27 +211,17 @@ jobs:
|
||||||
per_page: 100,
|
per_page: 100,
|
||||||
page: 1
|
page: 1
|
||||||
});
|
});
|
||||||
const expireMillis = 1000 * 60 * 60 * 24 * 7;
|
for (const issue of issues.data.values()) {
|
||||||
const curtime = new Date().getTime();
|
|
||||||
for (var issue of issues.data.values()) {
|
|
||||||
const updatetime = new Date(issue.updated_at).getTime();
|
const updatetime = new Date(issue.updated_at).getTime();
|
||||||
if (curtime < updatetime + expireMillis)
|
if (curtime < updatetime + expireMillis)
|
||||||
continue;
|
continue;
|
||||||
msg = "This PR is being closed because it is currently not"
|
await github.rest.issues.createComment({
|
||||||
+ " considered a good match for the master Klipper"
|
|
||||||
+ " repository."
|
|
||||||
+ "\n\n"
|
|
||||||
+ "Best regards,\n"
|
|
||||||
+ "~ Your friendly GitIssueBot"
|
|
||||||
+ "\n\n"
|
|
||||||
+ "PS: I'm just an automated script, not a human being.";
|
|
||||||
await github.issues.createComment({
|
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
body: msg
|
body: msg
|
||||||
});
|
});
|
||||||
await github.issues.update({
|
await github.rest.issues.update({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
|
@ -233,10 +233,20 @@ jobs:
|
||||||
if: github.repository == 'Klipper3d/klipper'
|
if: github.repository == 'Klipper3d/klipper'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v3
|
- uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const issues = await github.issues.listForRepo({
|
msg = "It looks like this GitHub Pull Request has become"
|
||||||
|
+ " inactive. If there are any further updates, you can"
|
||||||
|
+ " add a comment here or open a new ticket."
|
||||||
|
+ "\n\n"
|
||||||
|
+ "Best regards,\n"
|
||||||
|
+ "~ Your friendly GitIssueBot"
|
||||||
|
+ "\n\n"
|
||||||
|
+ "PS: I'm just an automated script, not a human being.";
|
||||||
|
const expireMillis = 1000 * 60 * 60 * 24 * 21;
|
||||||
|
const curtime = new Date().getTime();
|
||||||
|
const issues = await github.rest.issues.listForRepo({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
state: 'open',
|
state: 'open',
|
||||||
|
@ -244,33 +254,23 @@ jobs:
|
||||||
per_page: 100,
|
per_page: 100,
|
||||||
page: 1
|
page: 1
|
||||||
});
|
});
|
||||||
const expireMillis = 1000 * 60 * 60 * 24 * 21;
|
for (const issue of issues.data.values()) {
|
||||||
const curtime = new Date().getTime();
|
|
||||||
for (var issue of issues.data.values()) {
|
|
||||||
const updatetime = new Date(issue.updated_at).getTime();
|
const updatetime = new Date(issue.updated_at).getTime();
|
||||||
if (curtime < updatetime + expireMillis)
|
if (curtime < updatetime + expireMillis)
|
||||||
continue;
|
continue;
|
||||||
msg = "It looks like this GitHub Pull Request has become"
|
await github.rest.issues.addLabels({
|
||||||
+ " inactive. If there are any further updates, you can"
|
|
||||||
+ " add a comment here or open a new ticket."
|
|
||||||
+ "\n\n"
|
|
||||||
+ "Best regards,\n"
|
|
||||||
+ "~ Your friendly GitIssueBot"
|
|
||||||
+ "\n\n"
|
|
||||||
+ "PS: I'm just an automated script, not a human being.";
|
|
||||||
await github.issues.addLabels({
|
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
labels: ['inactive']
|
labels: ['inactive']
|
||||||
});
|
});
|
||||||
await github.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
body: msg
|
body: msg
|
||||||
});
|
});
|
||||||
await github.issues.update({
|
await github.rest.issues.update({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
|
|
Loading…
Reference in New Issue