mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Replace fabricbot with GHA for scheduled issue closing (#54566)
Co-authored-by: Ryan Cavanaugh <RyanCavanaugh@users.noreply.github.com>
This commit is contained in:
parent
fbd63e9e43
commit
e8a1dbba22
344
.github/fabricbot.json
vendored
344
.github/fabricbot.json
vendored
@ -108,177 +108,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskType": "scheduled",
|
||||
"capabilityId": "ScheduledSearch",
|
||||
"subCapability": "ScheduledSearch",
|
||||
"version": "1.0",
|
||||
"config": {
|
||||
"frequency": [
|
||||
{
|
||||
"weekDay": 0,
|
||||
"hours": [
|
||||
18
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 1,
|
||||
"hours": [
|
||||
18
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 2,
|
||||
"hours": [
|
||||
18
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 3,
|
||||
"hours": [
|
||||
18
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 4,
|
||||
"hours": [
|
||||
18
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 5,
|
||||
"hours": [
|
||||
18
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 6,
|
||||
"hours": [
|
||||
18
|
||||
]
|
||||
}
|
||||
],
|
||||
"searchTerms": [
|
||||
{
|
||||
"name": "noActivitySince",
|
||||
"parameters": {
|
||||
"days": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "hasLabel",
|
||||
"parameters": {
|
||||
"label": "Duplicate"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isOpen",
|
||||
"parameters": {}
|
||||
}
|
||||
],
|
||||
"taskName": "Close Duplicates",
|
||||
"actions": [
|
||||
{
|
||||
"name": "closeIssue",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "addReply",
|
||||
"parameters": {
|
||||
"comment": "This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskType": "scheduled",
|
||||
"capabilityId": "ScheduledSearch",
|
||||
"subCapability": "ScheduledSearch",
|
||||
"version": "1.0",
|
||||
"config": {
|
||||
"taskName": "Close Externals",
|
||||
"frequency": [
|
||||
{
|
||||
"weekDay": 0,
|
||||
"hours": [
|
||||
10
|
||||
],
|
||||
"restrictions": [
|
||||
{
|
||||
"name": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 1,
|
||||
"hours": [
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 2,
|
||||
"hours": [
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 3,
|
||||
"hours": [
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 4,
|
||||
"hours": [
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 5,
|
||||
"hours": [
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 6,
|
||||
"hours": [
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
"searchTerms": [
|
||||
{
|
||||
"name": "hasLabel",
|
||||
"parameters": {
|
||||
"label": "External"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isOpen",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "noActivitySince",
|
||||
"parameters": {
|
||||
"days": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
{
|
||||
"name": "closeIssue",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "addReply",
|
||||
"parameters": {
|
||||
"comment": "This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskType": "trigger",
|
||||
"capabilityId": "IssueResponder",
|
||||
@ -372,89 +201,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskType": "scheduled",
|
||||
"capabilityId": "ScheduledSearch",
|
||||
"subCapability": "ScheduledSearch",
|
||||
"version": "1.0",
|
||||
"config": {
|
||||
"taskName": "Close Working as Intended",
|
||||
"frequency": [
|
||||
{
|
||||
"weekDay": 0,
|
||||
"hours": [
|
||||
20
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 1,
|
||||
"hours": [
|
||||
20
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 2,
|
||||
"hours": [
|
||||
20
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 3,
|
||||
"hours": [
|
||||
20
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 4,
|
||||
"hours": [
|
||||
20
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 5,
|
||||
"hours": [
|
||||
20
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 6,
|
||||
"hours": [
|
||||
20
|
||||
]
|
||||
}
|
||||
],
|
||||
"searchTerms": [
|
||||
{
|
||||
"name": "hasLabel",
|
||||
"parameters": {
|
||||
"label": "Working as Intended"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isOpen",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "noActivitySince",
|
||||
"parameters": {
|
||||
"days": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
{
|
||||
"name": "addReply",
|
||||
"parameters": {
|
||||
"comment": "This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "closeIssue",
|
||||
"parameters": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskType": "trigger",
|
||||
"capabilityId": "IssueResponder",
|
||||
@ -494,96 +240,6 @@
|
||||
},
|
||||
"disabled": true
|
||||
},
|
||||
{
|
||||
"taskType": "scheduled",
|
||||
"capabilityId": "ScheduledSearch",
|
||||
"subCapability": "ScheduledSearch",
|
||||
"version": "1.1",
|
||||
"config": {
|
||||
"taskName": "Close Questions",
|
||||
"frequency": [
|
||||
{
|
||||
"weekDay": 0,
|
||||
"hours": [
|
||||
0,
|
||||
12
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 1,
|
||||
"hours": [
|
||||
0,
|
||||
12
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 2,
|
||||
"hours": [
|
||||
0,
|
||||
12
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 3,
|
||||
"hours": [
|
||||
0,
|
||||
12
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 4,
|
||||
"hours": [
|
||||
0,
|
||||
12
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 5,
|
||||
"hours": [
|
||||
0,
|
||||
12
|
||||
]
|
||||
},
|
||||
{
|
||||
"weekDay": 6,
|
||||
"hours": [
|
||||
0,
|
||||
12
|
||||
]
|
||||
}
|
||||
],
|
||||
"searchTerms": [
|
||||
{
|
||||
"name": "hasLabel",
|
||||
"parameters": {
|
||||
"label": "Question"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isOpen",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "noActivitySince",
|
||||
"parameters": {
|
||||
"days": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
{
|
||||
"name": "closeIssue",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "addReply",
|
||||
"parameters": {
|
||||
"comment": "This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to [stackoverflow](https://stackoverflow.com/questions/tagged/typescript) or the [TypeScript Discord community](https://discord.gg/typescript)."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskType": "trigger",
|
||||
"capabilityId": "IssueResponder",
|
||||
|
||||
43
.github/workflows/close-issues.yml
vendored
Normal file
43
.github/workflows/close-issues.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
name: Close issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 1 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# Ensure scripts are run with pipefail. See:
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
close-issues:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'microsoft/TypeScript'
|
||||
permissions:
|
||||
contents: read # Apparently required to create issues
|
||||
issues: write
|
||||
|
||||
steps:
|
||||
- name: Close issues
|
||||
run: |
|
||||
DATE=$(date --date='2 days ago' --iso-8601)
|
||||
|
||||
close_issues() {
|
||||
echo "Closing issues marked as '$1'."
|
||||
for issue in $(gh issue list --label "$1" --repo ${{ github.repository }} --state open --search "updated:<$DATE" --json number --jq '.[].number'); do
|
||||
echo "Closing https://github.com/${{ github.repository }}/issues/$issue"
|
||||
gh issue close $issue --reason "not planned" --comment "This issue has been marked as '$1' and has seen no recent activity. It has been automatically closed for house-keeping purposes."
|
||||
done
|
||||
}
|
||||
|
||||
close_issues "Duplicate"
|
||||
close_issues "Unactionable"
|
||||
close_issues "Not a Defect"
|
||||
close_issues "External"
|
||||
close_issues "Working as Intended"
|
||||
close_issues "Question"
|
||||
Loading…
x
Reference in New Issue
Block a user