From ccb6b9b8a128b6f6ac83358fd29c3276f9494b55 Mon Sep 17 00:00:00 2001 From: Mark Cohen Date: Mon, 20 May 2024 09:44:22 -0400 Subject: [PATCH 1/2] adds a GH action to label PRs without activity for more than 30 days that runs on a cron; closes #1981 Signed-off-by: Mark Cohen --- .github/workflows/stalled.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/stalled.yml diff --git a/.github/workflows/stalled.yml b/.github/workflows/stalled.yml new file mode 100644 index 0000000000..a612362a68 --- /dev/null +++ b/.github/workflows/stalled.yml @@ -0,0 +1,28 @@ +name: Label Stalled PRs +on: + schedule: + - cron: '15 15 * * *' # Run every day at 15:15 UTC / 7:15 PST / 8:15 PDT +permissions: + pull-requests: write +jobs: + stale: + if: github.repository == 'awslabs/aws-athena-query-federation' + runs-on: ubuntu-latest + steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v2.1.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + - name: Stale PRs + uses: actions/stale@v9 + with: + repo-token: ${{ steps.github_app_token.outputs.token }} + stale-pr-label: 'stalled' + stale-pr-message: 'This PR is stalled because it has been open for 30 days with no activity.' + days-before-pr-stale: 30 + days-before-issue-stale: -1 + days-before-pr-close: -1 + days-before-issue-close: -1 \ No newline at end of file From a61ab1037e42973685af1bbfa15787a531e0bfe8 Mon Sep 17 00:00:00 2001 From: Mark Cohen Date: Tue, 21 May 2024 15:27:07 -0400 Subject: [PATCH 2/2] switched the action to use aws-actions/stale-issue-cleanup due to complex and unnecessary permissions issues from the prior action used Signed-off-by: Mark Cohen --- .github/workflows/stalled.yml | 38 ++++++++++++++++------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/stalled.yml b/.github/workflows/stalled.yml index a612362a68..339720e6fa 100644 --- a/.github/workflows/stalled.yml +++ b/.github/workflows/stalled.yml @@ -2,27 +2,23 @@ name: Label Stalled PRs on: schedule: - cron: '15 15 * * *' # Run every day at 15:15 UTC / 7:15 PST / 8:15 PDT -permissions: - pull-requests: write jobs: - stale: - if: github.repository == 'awslabs/aws-athena-query-federation' + cleanup: runs-on: ubuntu-latest + name: Stale PRs steps: - - name: GitHub App token - id: github_app_token - uses: tibdex/github-app-token@v2.1.0 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - installation_id: 22958780 - - name: Stale PRs - uses: actions/stale@v9 - with: - repo-token: ${{ steps.github_app_token.outputs.token }} - stale-pr-label: 'stalled' - stale-pr-message: 'This PR is stalled because it has been open for 30 days with no activity.' - days-before-pr-stale: 30 - days-before-issue-stale: -1 - days-before-pr-close: -1 - days-before-issue-close: -1 \ No newline at end of file + - uses: aws-actions/stale-issue-cleanup@v3 + with: + stale-pr-message: This PR has been open without activity for more than 30 days. Labeling this issue stalled. Please close the PR if it is no longer necessary. + stale-issue-label: stalled + exempt-issue-labels: awaiting-approval + stale-pr-label: no-pr-activity + exempt-pr-labels: awaiting-approval + response-requested-label: response-requested + + closed-for-staleness-label: closed-for-staleness + + stale-pr-label: 'stalled' + stale-pr-message: 'This PR is stalled because it has been open for 30 days with no activity.' + days-before-stale: 30 + repo-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file