aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2022-03-13 17:09:08 -0400
committerKevin O'Connor <kevin@koconnor.net>2022-03-13 17:13:56 -0400
commit021459e53ec79f9a3ef7819aae4dffd2d4d6d8e2 (patch)
tree3b8b0af5fbf9926db519a1ecb4d108b4d05bc91c /.github
parent2f8f99acae74e67f925d535a9a9a2ef172d392c5 (diff)
downloadkutter-021459e53ec79f9a3ef7819aae4dffd2d4d6d8e2.tar.gz
kutter-021459e53ec79f9a3ef7819aae4dffd2d4d6d8e2.tar.xz
kutter-021459e53ec79f9a3ef7819aae4dffd2d4d6d8e2.zip
workflows: Update stale-issue-bot.yaml to use actions/github-script@v6
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/stale-issue-bot.yaml102
1 files changed, 51 insertions, 51 deletions
diff --git a/.github/workflows/stale-issue-bot.yaml b/.github/workflows/stale-issue-bot.yaml
index 83f91244..87d8cf1b 100644
--- a/.github/workflows/stale-issue-bot.yaml
+++ b/.github/workflows/stale-issue-bot.yaml
@@ -36,10 +36,12 @@ jobs:
if: github.repository == 'Klipper3d/klipper'
runs-on: ubuntu-latest
steps:
- - uses: actions/github-script@v3
+ - uses: actions/github-script@v6
with:
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,
repo: context.repo.repo,
state: 'open',
@@ -47,13 +49,11 @@ jobs:
per_page: 100,
page: 1
});
- const expireMillis = 1000 * 60 * 60 * 36;
- const curtime = new Date().getTime();
- for (var issue of issues.data.values()) {
+ for (const issue of issues.data.values()) {
const updatetime = new Date(issue.updated_at).getTime();
if (curtime < updatetime + expireMillis)
continue;
- await github.issues.update({
+ await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
@@ -148,10 +148,19 @@ jobs:
if: github.repository == 'Klipper3d/klipper'
runs-on: ubuntu-latest
steps:
- - uses: actions/github-script@v3
+ - uses: actions/github-script@v6
with:
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,
repo: context.repo.repo,
state: 'open',
@@ -159,26 +168,17 @@ jobs:
per_page: 100,
page: 1
});
- const expireMillis = 1000 * 60 * 60 * 24 * 7;
- const curtime = new Date().getTime();
- for (var issue of issues.data.values()) {
+ for (const issue of issues.data.values()) {
const updatetime = new Date(issue.updated_at).getTime();
if (curtime < updatetime + expireMillis)
continue;
- 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.";
- await github.issues.createComment({
+ await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: msg
});
- await github.issues.update({
+ await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
@@ -190,10 +190,20 @@ jobs:
if: github.repository == 'Klipper3d/klipper'
runs-on: ubuntu-latest
steps:
- - uses: actions/github-script@v3
+ - uses: actions/github-script@v6
with:
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,
repo: context.repo.repo,
state: 'open',
@@ -201,27 +211,17 @@ jobs:
per_page: 100,
page: 1
});
- const expireMillis = 1000 * 60 * 60 * 24 * 7;
- const curtime = new Date().getTime();
- for (var issue of issues.data.values()) {
+ for (const issue of issues.data.values()) {
const updatetime = new Date(issue.updated_at).getTime();
if (curtime < updatetime + expireMillis)
continue;
- 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.";
- await github.issues.createComment({
+ await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: msg
});
- await github.issues.update({
+ await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
@@ -233,10 +233,20 @@ jobs:
if: github.repository == 'Klipper3d/klipper'
runs-on: ubuntu-latest
steps:
- - uses: actions/github-script@v3
+ - uses: actions/github-script@v6
with:
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,
repo: context.repo.repo,
state: 'open',
@@ -244,33 +254,23 @@ jobs:
per_page: 100,
page: 1
});
- const expireMillis = 1000 * 60 * 60 * 24 * 21;
- const curtime = new Date().getTime();
- for (var issue of issues.data.values()) {
+ for (const issue of issues.data.values()) {
const updatetime = new Date(issue.updated_at).getTime();
if (curtime < updatetime + expireMillis)
continue;
- 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.";
- await github.issues.addLabels({
+ await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: ['inactive']
});
- await github.issues.createComment({
+ await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: msg
});
- await github.issues.update({
+ await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,