From 00a3f76f47bf885f0948f448ef040ee31c083eab Mon Sep 17 00:00:00 2001
From: devlooped-bot <bot@devlooped.com>
Date: Sat, 31 Aug 2024 00:12:21 +0000
Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20files=20with=20dotn?=
 =?UTF-8?q?et-file=20sync=20#=20devlooped/oss?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- Use custom stale action to exempt authors https://github.com/devlooped/oss/commit/03b7d53
- We don't push just from ubuntu anymore https://github.com/devlooped/oss/commit/7ec9101
- Skip discussion issues when generating changelog https://github.com/devlooped/oss/commit/08d83cb
---
 .github/workflows/build.yml        |  1 -
 .github/workflows/changelog.config |  2 +-
 .github/workflows/stale.yml        | 69 ++++++++++++++++++++++++++++++
 .netconfig                         | 13 ++++--
 readme.md                          |  2 +
 5 files changed, 81 insertions(+), 6 deletions(-)
 create mode 100644 .github/workflows/stale.yml

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f4a9bc6..648d55a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -79,7 +79,6 @@ jobs:
           name: logs
           path: '*.binlog'
 
-      # Only push CI package to sleet feed if building on ubuntu (fastest)
       - name: 🚀 sleet
         env:
           SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }}
diff --git a/.github/workflows/changelog.config b/.github/workflows/changelog.config
index cd34ee7..e47bccd 100644
--- a/.github/workflows/changelog.config
+++ b/.github/workflows/changelog.config
@@ -1,7 +1,7 @@
 usernames-as-github-logins=true
 issues_wo_labels=true
 pr_wo_labels=true
-exclude-labels=bydesign,dependencies,duplicate,question,invalid,wontfix,need info,docs
+exclude-labels=bydesign,dependencies,duplicate,discussion,question,invalid,wontfix,need info,docs
 enhancement-label=:sparkles: Implemented enhancements:
 bugs-label=:bug: Fixed bugs:
 issues-label=:hammer: Other:
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
new file mode 100644
index 0000000..2c06279
--- /dev/null
+++ b/.github/workflows/stale.yml
@@ -0,0 +1,69 @@
+name: 'stale'
+on:
+  schedule:
+    - cron: '42 0 * * *'
+
+  workflow_dispatch:
+    # Manual triggering through the GitHub UI, API, or CLI
+    inputs:
+      daysBeforeStale:
+        required: true
+        default: "180"
+      daysBeforeClose:
+        required: true
+        default: "30"
+      operationsPerRun:
+        required: true
+        default: "4000"
+
+permissions:
+  actions: write # For managing the operation state cache
+  issues: write
+
+jobs:
+  stale:
+    # Do not run on forks
+    if: github.repository_owner == 'devlooped' 
+    runs-on: ubuntu-latest
+    steps:
+      - name: ⌛ rate
+        shell: pwsh
+        if: github.event_name != 'workflow_dispatch'
+        env:
+          GH_TOKEN: ${{ github.token }}        
+        run: |
+          # add random sleep since we run on fixed schedule
+          $wait = get-random -max 180
+          echo "Waiting random $wait seconds to start"          
+          sleep $wait
+          # get currently authenticated user rate limit info
+          $rate = gh api rate_limit | convertfrom-json | select -expandproperty rate
+          # if we don't have at least 100 requests left, wait until reset
+          if ($rate.remaining -lt 100) {
+              $wait = ($rate.reset - (Get-Date (Get-Date).ToUniversalTime() -UFormat %s))
+              echo "Rate limit remaining is $($rate.remaining), waiting for $($wait / 1000) seconds to reset"
+              sleep $wait
+              $rate = gh api rate_limit | convertfrom-json | select -expandproperty rate
+              echo "Rate limit has reset to $($rate.remaining) requests"
+          }
+        
+      - name: ✏️ label
+        # pending merge: https://github.com/actions/stale/pull/1176
+        uses: kzu/stale@c8450312ba97b204bf37545cb249742144d6ca69
+        with:
+          ascending: true # Process the oldest issues first
+          stale-issue-label: 'stale'
+          stale-issue-message: |
+            Due to lack of recent activity, this issue has been labeled as 'stale'. 
+            It will be closed if no further activity occurs within ${{ fromJson(inputs.daysBeforeClose || 30  ) }} more days. 
+            Any new comment will remove the label.
+          close-issue-message: |
+            This issue will now be closed since it has been labeled 'stale' without activity for ${{ fromJson(inputs.daysBeforeClose || 30  ) }} days.
+          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
diff --git a/.netconfig b/.netconfig
index c61416b..cf47966 100644
--- a/.netconfig
+++ b/.netconfig
@@ -39,8 +39,8 @@
     skip
 [file ".github/workflows/build.yml"]
 	url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml
-	sha = b5bb972199aa6ff220dda196588b23c21bb2780f
-	etag = ce104e9b04fe6a54b90cdfd3d5c02f2e902f8ac878b1d059edc1b6bed70872be
+	sha = 7ec91019eddb4fc7e0b09118538b256087f82e18
+	etag = 35b2a5b03c26cbe7522e30b2b987e04991e8ba18accd38b7ebd88191f1698c2d
 	weak
 [file ".github/workflows/changelog.yml"]
 	url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.yml
@@ -125,6 +125,11 @@
 	weak
 [file ".github/workflows/changelog.config"]
 	url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.config
-	sha = 055a8b7c94b74ae139cce919d60b83976d2a9942
-	etag = ddb17acb5872e9e69a76f9dec0ca590f25382caa2ccf750df058dcabb674db2b
+	sha = 08d83cb510732f861416760d37702f9f55bd7f9e
+	etag = 556a28914eeeae78ca924b1105726cdaa211af365671831887aec81f5f4301b4
+	weak
+[file ".github/workflows/stale.yml"]
+	url = https://github.com/devlooped/oss/blob/main/.github/workflows/stale.yml
+	sha = 03b7d535f782ceaf918eeea82ca374bc8c93288a
+	etag = 1efabca4a7436d756e8d24e616a8ecda54f55b49eab623168149f042131e67d6
 	weak
diff --git a/readme.md b/readme.md
index 076f193..b023092 100644
--- a/readme.md
+++ b/readme.md
@@ -388,6 +388,8 @@ The versioning scheme for packages is:
 [![Vezel](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/vezel-dev.png "Vezel")](https://github.com/vezel-dev)
 [![ChilliCream](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/ChilliCream.png "ChilliCream")](https://github.com/ChilliCream)
 [![4OTC](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/4OTC.png "4OTC")](https://github.com/4OTC)
+[![Vincent Limo](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/v-limo.png "Vincent Limo")](https://github.com/v-limo)
+[![Brooke Hamilton](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/brooke-hamilton.png "Brooke Hamilton")](https://github.com/brooke-hamilton)
 
 
 <!-- sponsors.md -->