From fc505872d2c8da9f1dfb869ad8d6e311ee3470a2 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Mon, 19 Feb 2024 18:32:13 -0600 Subject: [PATCH 1/5] Update close-old-issues.yaml --- .github/workflows/close-old-issues.yaml | 56 ++++++++++++------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/.github/workflows/close-old-issues.yaml b/.github/workflows/close-old-issues.yaml index 5b472bc0..7fca4ccc 100644 --- a/.github/workflows/close-old-issues.yaml +++ b/.github/workflows/close-old-issues.yaml @@ -14,43 +14,39 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const octokit = github.getOctokit(); + const octokit = context.octokit; // Get the repository owner and name - const { owner, repo } = github.context.repo; + const { owner, repo } = context.repo; // Define the inactivity period (14 days) const inactivityPeriod = new Date(); inactivityPeriod.setDate(inactivityPeriod.getDate() - 14); - async function run() { - // Get all open issues - const issues = await octokit.issues.listForRepo({ - owner, - repo, - state: 'open', - }); + // Get all open issues + const { data: issues } = await octokit.rest.issues.listForRepo({ + owner, + repo, + state: 'open', + }); - // Close issues inactive for more than the inactivity period - for (const issue of issues.data) { - const lastCommentDate = issue.updated_at; - if (new Date(lastCommentDate) < inactivityPeriod) { - // Close the issue and add a comment - await octokit.issues.update({ - owner, - repo, - issue_number: issue.number, - state: 'closed', - }); + // Close issues inactive for more than the inactivity period + for (const issue of issues) { + const lastCommentDate = issue.updated_at; + if (new Date(lastCommentDate) < inactivityPeriod) { + // Close the issue and add a comment + await octokit.rest.issues.update({ + owner, + repo, + issue_number: issue.number, + state: 'closed', + }); - await octokit.issues.createComment({ - owner, - repo, - issue_number: issue.number, - body: 'Closed due to inactivity', - }); - } + await octokit.rest.issues.createComment({ + owner, + repo, + issue_number: issue.number, + body: 'Closed due to inactivity', + }); } - } - - run().catch(error => console.error(error)); + } \ No newline at end of file From 8e00077e50073cfd4b5d5f15fdee08d4d098d28f Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Tue, 20 Feb 2024 00:32:36 +0000 Subject: [PATCH 2/5] Compile Winutil --- winutil.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 3e750be9..2ec7e27d 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10,7 +10,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 24.02.07 + Version : 24.02.20 #> param ( [switch]$Debug, @@ -47,7 +47,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.02.07" +$sync.version = "24.02.20" $sync.configs = @{} $sync.ProcessRunning = $false @@ -7660,7 +7660,7 @@ $sync.configs.applications = '{ "WPFInstallintelpresentmon": { "category": "Utilities", "choco": "na", - "content": "Intel? PresentMon", + "content": "Intel?? PresentMon", "description": "A new gaming performance overlay and telemetry application to monitor and measure your gaming experience.", "link": "https://game.intel.com/us/stories/intel-presentmon/", "winget": "Intel.PresentMon.Beta" From 07eeed310b155048e036f0752f3ea10fa3c393f7 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Mon, 19 Feb 2024 18:39:24 -0600 Subject: [PATCH 3/5] Update close-old-issues.yaml --- .github/workflows/close-old-issues.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close-old-issues.yaml b/.github/workflows/close-old-issues.yaml index 7fca4ccc..72a3ca8e 100644 --- a/.github/workflows/close-old-issues.yaml +++ b/.github/workflows/close-old-issues.yaml @@ -14,7 +14,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const octokit = context.octokit; + const octokit = github; // Get the repository owner and name const { owner, repo } = context.repo; From e745d798b112514162b7785fe4e90337892b97d4 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Mon, 19 Feb 2024 18:43:44 -0600 Subject: [PATCH 4/5] Update close-old-issues.yaml --- .github/workflows/close-old-issues.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close-old-issues.yaml b/.github/workflows/close-old-issues.yaml index 72a3ca8e..e4910adc 100644 --- a/.github/workflows/close-old-issues.yaml +++ b/.github/workflows/close-old-issues.yaml @@ -3,7 +3,7 @@ name: Close Inactive Issues on: schedule: - cron: '0 0 * * *' # Run daily - + workflow_dispatch: # This line enables manual triggering jobs: close-issues: runs-on: ubuntu-latest From 31c6622926996854555e140acea128684a9fe9d5 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Mon, 19 Feb 2024 21:43:49 -0600 Subject: [PATCH 5/5] Update close-old-issues.yaml --- .github/workflows/close-old-issues.yaml | 61 +++++++++++++++---------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/.github/workflows/close-old-issues.yaml b/.github/workflows/close-old-issues.yaml index e4910adc..1b129a0a 100644 --- a/.github/workflows/close-old-issues.yaml +++ b/.github/workflows/close-old-issues.yaml @@ -7,6 +7,8 @@ on: jobs: close-issues: runs-on: ubuntu-latest + permissions: + issues: write # Ensure necessary permissions for issues steps: - name: Close inactive issues @@ -23,30 +25,41 @@ jobs: const inactivityPeriod = new Date(); inactivityPeriod.setDate(inactivityPeriod.getDate() - 14); - // Get all open issues - const { data: issues } = await octokit.rest.issues.listForRepo({ - owner, - repo, - state: 'open', - }); + try { + // Get all open issues with pagination + for await (const response of octokit.paginate.iterator(octokit.rest.issues.listForRepo, { + owner, + repo, + state: 'open', + })) { + const issues = response.data; - // Close issues inactive for more than the inactivity period - for (const issue of issues) { - const lastCommentDate = issue.updated_at; - if (new Date(lastCommentDate) < inactivityPeriod) { - // Close the issue and add a comment - await octokit.rest.issues.update({ - owner, - repo, - issue_number: issue.number, - state: 'closed', - }); + // Close issues inactive for more than the inactivity period + for (const issue of issues) { + const lastCommentDate = issue.updated_at; + if (new Date(lastCommentDate) < inactivityPeriod) { + try { + // Close the issue + await octokit.rest.issues.update({ + owner, + repo, + issue_number: issue.number, + state: 'closed', + }); - await octokit.rest.issues.createComment({ - owner, - repo, - issue_number: issue.number, - body: 'Closed due to inactivity', - }); + // Add a comment + await octokit.rest.issues.createComment({ + owner, + repo, + issue_number: issue.number, + body: 'Closed due to inactivity', + }); + } catch (error) { + console.error(`Error updating or commenting on issue #${issue.number}: ${error}`); + } + } + } } - } \ No newline at end of file + } catch (error) { + console.error(`Error fetching issues: ${error}`); + }