From 15dbadbfe0d86dafc29a5958928cc3f41538ba1f Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Thu, 13 Mar 2025 19:57:30 +0100 Subject: [PATCH] Move unstale to the issue/pr manager Doesn't make sense to run the scheduled workflow and then skip most of it's jobs. And it looks weird in the PR boxy thingy --- .github/workflows/issues-auto-manager.yml | 22 ++++++++++++++++- .github/workflows/job-close-stale.yml | 30 ----------------------- .github/workflows/pr-auto-manager.yml | 25 ++++++++++++++++--- 3 files changed, 43 insertions(+), 34 deletions(-) diff --git a/.github/workflows/issues-auto-manager.yml b/.github/workflows/issues-auto-manager.yml index 1c62bb66f..e35f71b66 100644 --- a/.github/workflows/issues-auto-manager.yml +++ b/.github/workflows/issues-auto-manager.yml @@ -1,8 +1,11 @@ -name: 🎯 Issues Auto Manager +name: 🎯 Issues Manager on: issues: types: [opened, edited, labeled, unlabeled] + # Re also listen to comments, to remove stale labels right away + issue_comment: + types: [created] jobs: label-on-content: @@ -67,6 +70,23 @@ jobs: token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} labels: 'βœ–οΈ Not Reproducible,βœ–οΈ Not A Bug' + remove-stale-label: + name: Remove Stale Label on Comment + runs-on: ubuntu-latest + # Only run this on new comments, to automatically remove the stale label + if: github.event_name == 'issue_comment' && github.actor != 'github-actions[bot]' + + steps: + - name: Remove Stale Label + # πŸ€– Issues Helper + # https://github.com/marketplace/actions/issues-helper + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-labels' + token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: '⚰️ Stale,πŸ•ΈοΈ Inactive,🚏 Awaiting User Response,πŸ›‘ No Response' + write-auto-comments: name: Post Issue Comments Based on Labels needs: [label-on-content, label-on-labels] diff --git a/.github/workflows/job-close-stale.yml b/.github/workflows/job-close-stale.yml index ea67d8e96..1d9a7de58 100644 --- a/.github/workflows/job-close-stale.yml +++ b/.github/workflows/job-close-stale.yml @@ -5,20 +5,11 @@ on: workflow_dispatch: schedule: - cron: '0 0 * * *' # Runs every day at midnight UTC - # Re also listen to comment created events or new PR pushes, to remove stale labels right away - issue_comment: - types: [created] - pull_request_review_comment: - types: [created] - pull_request: - types: [synchronize] jobs: mark-inactivity: name: Mark Issues/PRs without Activity runs-on: ubuntu-latest - # Only run this on the actual scheduled workflow - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' steps: - name: Mark Issues/PRs without Activity @@ -53,8 +44,6 @@ jobs: name: Mark Issues/PRs Awaiting User Response runs-on: ubuntu-latest needs: mark-inactivity - # Only run this on the actual scheduled workflow - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' steps: - name: Mark Issues/PRs Awaiting User Response @@ -82,8 +71,6 @@ jobs: name: Mark Issues with Alternative Exists runs-on: ubuntu-latest needs: await-user-response - # Only run this on the actual scheduled workflow - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' steps: - name: Mark Issues with Alternative Exists @@ -106,20 +93,3 @@ jobs: stale-issue-label: '🚏 Awaiting User Response' close-issue-label: 'πŸ•ΈοΈ Inactive' exempt-issue-labels: 'πŸ“Œ Keep Open' - - remove-stale-label: - name: Remove Stale Label on Comment - runs-on: ubuntu-latest - # Only run this on new comments or PR commits, to automatically remove the stale label - if: (github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'pull_request') && github.actor != 'github-actions[bot]' - - steps: - - name: Remove Stale Label - # πŸ€– Issues Helper - # https://github.com/marketplace/actions/issues-helper - uses: actions-cool/issues-helper@v3 - with: - actions: 'remove-labels' - token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} - labels: '⚰️ Stale,πŸ•ΈοΈ Inactive,🚏 Awaiting User Response,πŸ›‘ No Response' diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml index dc8c5441b..fb5a654ee 100644 --- a/.github/workflows/pr-auto-manager.yml +++ b/.github/workflows/pr-auto-manager.yml @@ -1,8 +1,10 @@ -name: 🎯 Pull Request Auto Manager +name: 🎯 Pull Request Manager on: pull_request_target: types: [opened, synchronize, reopened, edited, labeled, unlabeled, closed] + pull_request_review_comment: + types: [created] jobs: check-merge-conflicts: @@ -78,9 +80,26 @@ jobs: configuration-path: .github/pr-auto-labels-by-files.yml repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + remove-stale-label: + name: Remove Stale Label on Comment + runs-on: ubuntu-latest + # Only runs when this is not done by the github actions bot + if: github.actor != 'github-actions[bot]' + + steps: + - name: Remove Stale Label + # πŸ€– Issues Helper + # https://github.com/marketplace/actions/issues-helper + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-labels' + token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + labels: '⚰️ Stale' + check-merge-blocking-labels: name: Check Merge Blocking Labels - needs: [check-merge-conflicts, label-by-size, label-by-branches, label-by-files] + needs: [check-merge-conflicts, label-by-branches] runs-on: ubuntu-latest steps: @@ -123,7 +142,7 @@ jobs: write-auto-comments: name: Post PR Comments Based on Labels - needs: [check-merge-conflicts, label-by-size, label-by-branches, label-by-files] + needs: [check-merge-conflicts, label-by-size, label-by-branches, label-by-files, remove-stale-label] runs-on: ubuntu-latest steps: