This is an automated email from the ASF dual-hosted git repository.

bchapuis pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git


The following commit(s) were added to refs/heads/main by this push:
     new 4212c7867 Perform automatic actions on issues and pull requests (#942)
4212c7867 is described below

commit 4212c7867f08b2939cca36a731e28def74ad0851
Author: Yongjun Hong <[email protected]>
AuthorDate: Sat Feb 1 18:53:39 2025 +0900

    Perform automatic actions on issues and pull requests (#942)
    
    * Add the "new" label to newly created issues.
    
    * Mark inactive issues and PRs as "stalled" after a certain period.
    
    * Close inactive issues and PRs after a certain period.
---
 .github/workflows/close-inactive-issues.yml | 32 +++++++++++++++++++++++++++++
 .github/workflows/label-opened-issues.yml   | 30 +++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)

diff --git a/.github/workflows/close-inactive-issues.yml 
b/.github/workflows/close-inactive-issues.yml
new file mode 100644
index 000000000..c9e0d63e0
--- /dev/null
+++ b/.github/workflows/close-inactive-issues.yml
@@ -0,0 +1,32 @@
+name: Close inactive issues and PRs
+on:
+  schedule:
+    - cron: "30 1 * * *"
+  workflow_dispatch:
+permissions: read-all
+jobs:
+  close-issues:
+    runs-on: ubuntu-latest
+    permissions:
+      issues: write
+      pull-requests: write
+    steps:
+      - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
+        with:
+          only-labels: "status: waiting-for-feedback" # only consider issues 
and PRs with this label
+          days-before-stale: 30 # 1 month
+          days-before-close: 60 # 2 months after being stale
+          stale-issue-label: "status: stale"
+          stale-pr-label: "status: stale"
+          stale-issue-message: >
+            This issue has been inactive for a while. If you’re still 
interested, let us know how we can help! Our community is small, and we need 
contributors like you. 
+            If we don’t hear back, we may close it, but you’re always welcome 
to reopen it. Let’s build this together! 🚀
+          close-issue-message: >
+            Closing this issue due to inactivity. If you’re still interested, 
let us know! Our community is small, and we need contributors like you. 
+            If you provide more details or take the lead on a solution, we’ll 
be happy to re-open it. Let’s build this together! 🚀
+          stale-pr-message: >
+            This PR has been inactive for a while. If you’re still working on 
it, let us know how we can help! Our community is small, and we need 
contributors like you. 
+            If we don’t hear back, we may close it, but you’re always welcome 
to reopen it. Let’s build this together! 🚀
+          close-pr-message: >
+            Closing this PR due to inactivity. If you’d like to continue, let 
us know! Our community is small, and we need contributors like you. 
+            Feel free to re-open this PR or submit a new one when you’re 
ready. Let’s build this together! 🚀
diff --git a/.github/workflows/label-opened-issues.yml 
b/.github/workflows/label-opened-issues.yml
new file mode 100644
index 000000000..bbf37c72d
--- /dev/null
+++ b/.github/workflows/label-opened-issues.yml
@@ -0,0 +1,30 @@
+name: Add label to opened issues
+on:
+  issues:
+    types:
+      - opened
+permissions: read-all
+jobs:
+  label_issues:
+    runs-on: ubuntu-latest
+    permissions:
+      issues: write
+    steps:
+      - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # 
v7
+        with:
+          script: |
+            const issue = await github.rest.issues.get({
+              issue_number: context.issue.number,
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+            });
+            const originalLabels = issue.data.labels.map(l => l.name);
+            const statusLabels = originalLabels.filter(l => 
l.startsWith("status: "));
+            if (statusLabels.length === 0) {
+              github.rest.issues.addLabels({
+                issue_number: context.issue.number,
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                labels: ["status: new"]
+              })
+            }

Reply via email to