From eeca905107294c5c3747409954b8cb0a34025877 Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Thu, 7 Dec 2023 13:36:40 -0800 Subject: [PATCH] Migrate to the Locker GitHub action for locking closed/stale issues/PRs (#9647) Co-authored-by: Andrew Hall --- .github/fabricbot.json | 249 ------------------------------------ .github/workflow/locker.yml | 36 ++++++ 2 files changed, 36 insertions(+), 249 deletions(-) create mode 100644 .github/workflow/locker.yml diff --git a/.github/fabricbot.json b/.github/fabricbot.json index ff31c18857..107fb7d2fd 100644 --- a/.github/fabricbot.json +++ b/.github/fabricbot.json @@ -321,255 +321,6 @@ ] } }, - { - "taskType": "scheduled", - "capabilityId": "ScheduledSearch", - "subCapability": "ScheduledSearch", - "version": "1.1", - "config": { - "frequency": [ - { - "weekDay": 0, - "hours": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 1, - "hours": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 2, - "hours": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 3, - "hours": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 4, - "hours": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 5, - "hours": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 6, - "hours": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23 - ], - "timezoneOffset": -7 - } - ], - "searchTerms": [ - { - "name": "isClosed", - "parameters": {} - }, - { - "name": "noActivitySince", - "parameters": { - "days": 30 - } - }, - { - "name": "isIssue", - "parameters": {} - }, - { - "name": "isUnlocked", - "parameters": {} - } - ], - "taskName": "[Closed Issue Management] Lock issues closed without activity for over 30 days", - "actions": [ - { - "name": "lockIssue", - "parameters": { - "reason": "resolved" - } - } - ] - } - }, { "taskType": "scheduled", "capabilityId": "ScheduledSearch", diff --git a/.github/workflow/locker.yml b/.github/workflow/locker.yml new file mode 100644 index 0000000000..0e7b771510 --- /dev/null +++ b/.github/workflow/locker.yml @@ -0,0 +1,36 @@ +name: Locker - Lock stale issues and PRs +on: + schedule: + - cron: '0 9 * * *' # Once per day, early morning PT + + workflow_dispatch: + # Manual triggering through the GitHub UI, API, or CLI + inputs: + daysSinceClose: + required: true + default: "30" + daysSinceUpdate: + required: true + default: "30" + +permissions: + issues: write + pull-requests: write + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Checkout Actions + uses: actions/checkout@v4 + with: + repository: "microsoft/vscode-github-triage-actions" + path: ./actions + ref: cd16cd2aad6ba2da74bb6c6f7293adddd579a90e # locker action commit sha + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Run Locker + uses: ./actions/locker + with: + daysSinceClose: ${{ fromJson(inputs.daysSinceClose || 30) }} + daysSinceUpdate: ${{ fromJson(inputs.daysSinceUpdate || 30) }}