From 33000c0c4ab4eb4e0e142fa54515b811a189d55c Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Mon, 2 Sep 2024 02:14:03 -0300 Subject: [PATCH] Improve triage actions on issues Renames stale > triage to make it more representative. Adds old issues locker and need info closer. --- .github/workflows/{stale.yml => triage.yml} | 48 ++++++++++++++++++--- 1 file changed, 41 insertions(+), 7 deletions(-) rename .github/workflows/{stale.yml => triage.yml} (61%) diff --git a/.github/workflows/stale.yml b/.github/workflows/triage.yml similarity index 61% rename from .github/workflows/stale.yml rename to .github/workflows/triage.yml index 2c06279..56ff299 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/triage.yml @@ -1,4 +1,4 @@ -name: 'stale' +name: 'triage' on: schedule: - cron: '42 0 * * *' @@ -6,19 +6,27 @@ on: workflow_dispatch: # Manual triggering through the GitHub UI, API, or CLI inputs: + daysBeforeClose: + description: "Days before closing stale or need info issues" + required: true + default: "30" daysBeforeStale: + description: "Days before labeling stale" required: true default: "180" - daysBeforeClose: + daysSinceClose: + description: "Days since close to lock" required: true default: "30" - operationsPerRun: + daysSinceUpdate: + description: "Days since update to lock" required: true - default: "4000" + default: "30" permissions: actions: write # For managing the operation state cache issues: write + contents: read jobs: stale: @@ -30,7 +38,7 @@ jobs: shell: pwsh if: github.event_name != 'workflow_dispatch' env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.DEVLOOPED_TOKEN }} run: | # add random sleep since we run on fixed schedule $wait = get-random -max 180 @@ -47,7 +55,7 @@ jobs: echo "Rate limit has reset to $($rate.remaining) requests" } - - name: ✏️ label + - name: ✏️ stale labeler # pending merge: https://github.com/actions/stale/pull/1176 uses: kzu/stale@c8450312ba97b204bf37545cb249742144d6ca69 with: @@ -62,8 +70,34 @@ jobs: days-before-stale: ${{ fromJson(inputs.daysBeforeStale || 180) }} days-before-close: ${{ fromJson(inputs.daysBeforeClose || 30 ) }} days-before-pr-close: -1 # Do not close PRs labeled as 'stale' - operations-per-run: ${{ fromJson(inputs.operationsPerRun || 4000 )}} exempt-all-milestones: true exempt-all-assignees: true exempt-issue-labels: priority,sponsor,backed exempt-authors: kzu + + - name: 🤘 checkout actions + uses: actions/checkout@v4 + with: + repository: 'microsoft/vscode-github-triage-actions' + ref: v42 + + - name: ⚙ install actions + run: npm install --production + + - name: 🔒 issues locker + uses: ./locker + with: + token: ${{ secrets.DEVLOOPED_TOKEN }} + ignoredLabel: priority + daysSinceClose: ${{ fromJson(inputs.daysSinceClose || 30) }} + daysSinceUpdate: ${{ fromJson(inputs.daysSinceUpdate || 30) }} + + - name: 🔒 need info closer + uses: ./needs-more-info-closer + with: + token: ${{ secrets.DEVLOOPED_TOKEN }} + label: 'need info' + closeDays: ${{ fromJson(inputs.daysBeforeClose || 30) }} + closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity.\n\nHappy Coding!" + pingDays: 80 + pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the problem no longer exists, or adding more information." \ No newline at end of file