]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
.github/workflows: replace probot-stale with equivalent github action
authorLaura Flores <lflores@redhat.com>
Wed, 2 Mar 2022 20:03:56 +0000 (20:03 +0000)
committerLaura Flores <lflores@redhat.com>
Wed, 2 Mar 2022 20:03:56 +0000 (20:03 +0000)
We currently use probot-stale (https://github.com/probot/stale) to mark stale PRs. According to several issues reported for this repository, there is a widespread problem of probot-state not working properly in github projects (i.e. https://github.com/probot/stale/issues/349). Some users recommend using https://github.com/actions/stale instead.

Fixes: https://tracker.ceph.com/issues/54443
Signed-off-by: Laura Flores <lflores@redhat.com>
.github/stale.yml [deleted file]
.github/workflows/stale.yml [new file with mode: 0644]

diff --git a/.github/stale.yml b/.github/stale.yml
deleted file mode 100644 (file)
index d375db3..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-# Configuration for probot-stale - https://github.com/probot/stale
-
-# Number of days of inactivity before an Issue or Pull Request becomes stale
-daysUntilStale: 60
-
-# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
-# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
-daysUntilClose: 90
-
-# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
-exemptLabels:
-  - pinned
-  - security
-  - "[Status] Maybe Later"
-
-# Set to true to ignore issues in a project (defaults to false)
-exemptProjects: true
-
-# Set to true to ignore issues in a milestone (defaults to false)
-exemptMilestones: true
-
-# Label to use when marking as stale
-staleLabel: stale
-
-# Comment to post when marking as stale. Set to `false` to disable
-markComment: >
-  This pull request has been automatically marked as stale because it
-  has not had any activity for 60 days. It will be closed if no further
-  activity occurs for another 30 days.
-  
-  If you are a maintainer or core committer, please follow-up on this
-  pull request to identify what steps should be taken by the author to move this
-  proposed change forward.
-  
-  If you are the author of this pull request, thank you for your proposed
-  contribution.  If you believe this change is still appropriate, please
-  ensure that any feedback has been addressed and ask for a code review.
-
-# Comment to post when removing the stale label.
-# unmarkComment: >
-#   Your comment here.
-
-# Comment to post when closing a stale Issue or Pull Request.
-closeComment: >
-  This pull request has been automatically closed because there has
-  been no activity for 90 days.  Please feel free to reopen this pull
-  request (or open a new one) if the proposed change is still
-  appropriate.  Thank you for your contribution!
-
-# Limit the number of actions per hour, from 1-30. Default is 30
-limitPerRun: 30
-
-# Limit to only `issues` or `pulls`
-only: pulls
-
-# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
-# pulls:
-#   daysUntilStale: 30
-#   markComment: >
-#     This pull request has been automatically marked as stale because it has not had
-#     recent activity. It will be closed if no further activity occurs. Thank you
-#     for your contributions.
-
-# issues:
-#   exemptLabels:
-#     - confirmed
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
new file mode 100644 (file)
index 0000000..96fdc9f
--- /dev/null
@@ -0,0 +1,54 @@
+# Configuration for stale action workflow - https://github.com/actions/stale
+
+name: 'Close stale issues and PRs'
+on:
+  schedule:
+    - cron: '30 1 * * *'
+
+jobs:
+  stale:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/stale@v5
+        with:
+          # PAT for GitHub API authentication
+          repo-token: "${{ secrets.GITHUB_TOKEN }}"
+
+          # Comment on the staled PRs
+          stale-pr-message: >
+                  This pull request has been automatically marked as stale because it
+                  has not had any activity for 60 days. It will be closed if no further
+                  activity occurs for another 30 days.
+                  
+                  If you are a maintainer or core committer, please follow-up on this
+                  pull request to identify what steps should be taken by the author to move this
+                  proposed change forward.
+                  
+                  If you are the author of this pull request, thank you for your proposed
+                  contribution.  If you believe this change is still appropriate, please
+                  ensure that any feedback has been addressed and ask for a code review.
+          
+          # Comment on the staled PRs while closed
+          close-pr-message: >
+                  This pull request has been automatically closed because there has
+                  been no activity for 90 days.  Please feel free to reopen this pull
+                  request (or open a new one) if the proposed change is still
+                  appropriate.  Thank you for your contribution!
+          
+          # Idle number of days before making PRs stale (exempts Issues)
+          days-before-pr-stale: 60
+          
+          # Idle number of days before closing stale PRs (exempts Issues)
+          days-before-pr-close: 90
+          
+          # Label to apply on staled PRs
+          stale-pr-label: 'stale'
+          
+          # Labels on PRs exempted from stale
+          exempt-pr-labels: 'pinned,security'
+          
+          # Exempt all PRs with milestones from stale (also exempts Issues)
+          exempt-all-pr-milestones: true
+          
+          # Max number of operations per run
+          operations-per-run: 30