mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-05 12:43:50 -05:00
Compare commits
5 Commits
c842584cfe
...
e745d798b1
Author | SHA1 | Date | |
---|---|---|---|
e745d798b1 | |||
a29364984b | |||
07eeed310b | |||
8e00077e50 | |||
fc505872d2 |
58
.github/workflows/close-old-issues.yaml
vendored
58
.github/workflows/close-old-issues.yaml
vendored
@ -3,7 +3,7 @@ name: Close Inactive Issues
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *' # Run daily
|
- cron: '0 0 * * *' # Run daily
|
||||||
|
workflow_dispatch: # This line enables manual triggering
|
||||||
jobs:
|
jobs:
|
||||||
close-issues:
|
close-issues:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -14,43 +14,39 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
const octokit = github.getOctokit();
|
const octokit = github;
|
||||||
|
|
||||||
// Get the repository owner and name
|
// Get the repository owner and name
|
||||||
const { owner, repo } = github.context.repo;
|
const { owner, repo } = context.repo;
|
||||||
|
|
||||||
// Define the inactivity period (14 days)
|
// Define the inactivity period (14 days)
|
||||||
const inactivityPeriod = new Date();
|
const inactivityPeriod = new Date();
|
||||||
inactivityPeriod.setDate(inactivityPeriod.getDate() - 14);
|
inactivityPeriod.setDate(inactivityPeriod.getDate() - 14);
|
||||||
|
|
||||||
async function run() {
|
// Get all open issues
|
||||||
// Get all open issues
|
const { data: issues } = await octokit.rest.issues.listForRepo({
|
||||||
const issues = await octokit.issues.listForRepo({
|
owner,
|
||||||
owner,
|
repo,
|
||||||
repo,
|
state: 'open',
|
||||||
state: 'open',
|
});
|
||||||
});
|
|
||||||
|
|
||||||
// Close issues inactive for more than the inactivity period
|
// Close issues inactive for more than the inactivity period
|
||||||
for (const issue of issues.data) {
|
for (const issue of issues) {
|
||||||
const lastCommentDate = issue.updated_at;
|
const lastCommentDate = issue.updated_at;
|
||||||
if (new Date(lastCommentDate) < inactivityPeriod) {
|
if (new Date(lastCommentDate) < inactivityPeriod) {
|
||||||
// Close the issue and add a comment
|
// Close the issue and add a comment
|
||||||
await octokit.issues.update({
|
await octokit.rest.issues.update({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
state: 'closed',
|
state: 'closed',
|
||||||
});
|
});
|
||||||
|
|
||||||
await octokit.issues.createComment({
|
await octokit.rest.issues.createComment({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
issue_number: issue.number,
|
issue_number: issue.number,
|
||||||
body: 'Closed due to inactivity',
|
body: 'Closed due to inactivity',
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
run().catch(error => console.error(error));
|
|
@ -10,7 +10,7 @@
|
|||||||
Author : Chris Titus @christitustech
|
Author : Chris Titus @christitustech
|
||||||
Runspace Author: @DeveloperDurp
|
Runspace Author: @DeveloperDurp
|
||||||
GitHub : https://github.com/ChrisTitusTech
|
GitHub : https://github.com/ChrisTitusTech
|
||||||
Version : 24.02.07
|
Version : 24.02.20
|
||||||
#>
|
#>
|
||||||
param (
|
param (
|
||||||
[switch]$Debug,
|
[switch]$Debug,
|
||||||
@ -47,7 +47,7 @@ Add-Type -AssemblyName System.Windows.Forms
|
|||||||
# Variable to sync between runspaces
|
# Variable to sync between runspaces
|
||||||
$sync = [Hashtable]::Synchronized(@{})
|
$sync = [Hashtable]::Synchronized(@{})
|
||||||
$sync.PSScriptRoot = $PSScriptRoot
|
$sync.PSScriptRoot = $PSScriptRoot
|
||||||
$sync.version = "24.02.07"
|
$sync.version = "24.02.20"
|
||||||
$sync.configs = @{}
|
$sync.configs = @{}
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
|
|
||||||
@ -7660,7 +7660,7 @@ $sync.configs.applications = '{
|
|||||||
"WPFInstallintelpresentmon": {
|
"WPFInstallintelpresentmon": {
|
||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
"choco": "na",
|
"choco": "na",
|
||||||
"content": "Intel? PresentMon",
|
"content": "Intel?? PresentMon",
|
||||||
"description": "A new gaming performance overlay and telemetry application to monitor and measure your gaming experience.",
|
"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/",
|
"link": "https://game.intel.com/us/stories/intel-presentmon/",
|
||||||
"winget": "Intel.PresentMon.Beta"
|
"winget": "Intel.PresentMon.Beta"
|
||||||
|
Reference in New Issue
Block a user