From c95ba41debe26ef3c7c640749daa37488292077b Mon Sep 17 00:00:00 2001 From: Suraj Nath <9503187+electron0zero@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:13:38 +0530 Subject: [PATCH 1/2] Mark pull request and issues as stale after 90d of inactivity Signed-off-by: Suraj Nath <9503187+electron0zero@users.noreply.github.com> --- .github/stale.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000..5990d73af --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,42 @@ +name: Stale check +on: + workflow_dispatch: {} + schedule: + - cron: '0 0 * * *' +permissions: + issues: write + pull-requests: write +jobs: + stale: + # only run in prometheus/blackbox_exporter, and don't run this workflow in forks. + if: github.repository == 'prometheus/blackbox_exporter' + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6.0.1 + with: + close-issue-reason: not_planned + operations-per-run: 100 + days-before-stale: 90 + days-before-close: 30 + stale-issue-message: > + This issue has been automatically marked as stale because it has + not had any activity in the past 90 days. + + The next time this stale check runs, the stale label will be + removed if there is new activity. The issue will be closed after 30 + days if there is no new activity. + + Please apply keepalive label to exempt this Issue. + stale-pr-message: > + This PR has been automatically marked as stale because it has not + had any activity in the past 90 days. + + The next time this stale check runs, the stale label will be + removed if there is new activity. This pull request will be closed in 30 + days if there is no new activity. + + Please apply keepalive label to exempt this Pull Request. + stale-issue-label: stale + stale-pr-label: stale + exempt-issue-labels: keepalive,dependencies,bug + exempt-pr-labels: keepalive,dependencies,bug \ No newline at end of file From 44a1913351d12a14749fe2b2011c8575f4615660 Mon Sep 17 00:00:00 2001 From: Suraj Nath <9503187+electron0zero@users.noreply.github.com> Date: Wed, 18 Sep 2024 12:44:13 +0530 Subject: [PATCH 2/2] create stale.yml for repo_sync automation repo_sync automation in prometheus/prometheus only syncs the files that exist in the target repo, so create .github/workflows/stale.yml to register and then automation will keep it in sync with prometheus/prometheus Signed-off-by: Suraj Nath <9503187+electron0zero@users.noreply.github.com> --- .github/stale.yml | 42 ------------------------------------- .github/workflows/stale.yml | 31 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 42 deletions(-) delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 5990d73af..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Stale check -on: - workflow_dispatch: {} - schedule: - - cron: '0 0 * * *' -permissions: - issues: write - pull-requests: write -jobs: - stale: - # only run in prometheus/blackbox_exporter, and don't run this workflow in forks. - if: github.repository == 'prometheus/blackbox_exporter' - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v6.0.1 - with: - close-issue-reason: not_planned - operations-per-run: 100 - days-before-stale: 90 - days-before-close: 30 - stale-issue-message: > - This issue has been automatically marked as stale because it has - not had any activity in the past 90 days. - - The next time this stale check runs, the stale label will be - removed if there is new activity. The issue will be closed after 30 - days if there is no new activity. - - Please apply keepalive label to exempt this Issue. - stale-pr-message: > - This PR has been automatically marked as stale because it has not - had any activity in the past 90 days. - - The next time this stale check runs, the stale label will be - removed if there is new activity. This pull request will be closed in 30 - days if there is no new activity. - - Please apply keepalive label to exempt this Pull Request. - stale-issue-label: stale - stale-pr-label: stale - exempt-issue-labels: keepalive,dependencies,bug - exempt-pr-labels: keepalive,dependencies,bug \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..2b46ca4da --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,31 @@ +name: Stale Check +on: + workflow_dispatch: {} + schedule: + - cron: '16 22 * * *' +permissions: + issues: write + pull-requests: write +jobs: + stale: + if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks. + runs-on: ubuntu-latest + steps: + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + # opt out of defaults to avoid marking issues as stale and closing them + # https://github.com/actions/stale#days-before-close + # https://github.com/actions/stale#days-before-stale + days-before-stale: -1 + days-before-close: -1 + # Setting it to empty string to skip comments. + # https://github.com/actions/stale#stale-pr-message + # https://github.com/actions/stale#stale-issue-message + stale-pr-message: '' + stale-issue-message: '' + operations-per-run: 30 + # override days-before-stale, for only marking the pull requests as stale + days-before-pr-stale: 60 + stale-pr-label: stale + exempt-pr-labels: keepalive \ No newline at end of file