YongGoose commented on code in PR #942:
URL: 
https://github.com/apache/incubator-baremaps/pull/942#discussion_r1938246675


##########
.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

Review Comment:
   This part checks for issues and PRs that are labeled with `status: 
waiting-for-feedback`. 
   So, we need to create the `status: waiting-for-feedback` label.



##########
.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"

Review Comment:
   This part of the code checks issues and PRs in a stale state using this 
label. 
   Therefore, we should create the `status: stale` label.



##########
.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"]

Review Comment:
   This part of the workflow automatically applies the `status: new` label when 
a new issue is opened. 
   Therefore, we need to create the `status: new` label.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to