From bf75e8893167a0e7a76108bb50fd583275ef69b5 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Mon, 10 Mar 2025 19:40:02 +0100 Subject: [PATCH 01/26] Update PR size workflow --- .github/workflows/get-pr-size.yml | 68 +++++++++++++++---------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/get-pr-size.yml b/.github/workflows/get-pr-size.yml index ac5f9d4d3..4bc0a8f6c 100644 --- a/.github/workflows/get-pr-size.yml +++ b/.github/workflows/get-pr-size.yml @@ -1,39 +1,39 @@ -# Adds a comment to new PRs, showing the compressed size and size difference of new code -# And also labels the PR based on the number of lines changes +# Adds labels to pull requests based on the size of the changes (changed lines) + +# 🏷 Pull Request Size Labeler +# https://github.com/marketplace/actions/pull-request-size-labeler + +name: 🌈 Label PR Size -name: 🌈 Check PR Size on: [pull_request] + jobs: - build: + labeler: + permissions: + pull-requests: write + contents: read + issues: write runs-on: ubuntu-latest + name: Label the PR size steps: - - name: Checkout - uses: actions/checkout@v2 - # Find and comment with compressed size - - name: Get Compressed Size - uses: preactjs/compressed-size-action@v2 - with: - repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - pattern: './dist/**/*.{js,css,html}' - strip-hash: '\\b\\w{8}\\.' - exclude: '**/node_modules/**' - minimum-change-threshold: 100 - # Check number of lines of code added - - name: Label based on Lines of Code - uses: codelytv/pr-size-labeler@v1 - with: - GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - xs_max_size: '10' - s_max_size: '100' - m_max_size: '500' - l_max_size: '1000' - s_label: '🟩 PR - Small' - m_label: '🟨 PR - Medium' - l_label: '🟧 PR - Large' - xl_label: 'πŸŸ₯ PR - XL' - fail_if_xl: 'false' - message_if_xl: > - It looks like this PR is very large (over 1000 lines). - Try to avoid addressing multiple issues in a single PR, and - in the future consider breaking large tasks down into smaller steps. - This it to make reviewing, testing, reverting and general quality management easier. \ No newline at end of file + - uses: codelytv/pr-size-labeler@v1 + with: + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + xs_label: 'PR - Small' + xs_max_size: '1' + s_label: 'PR - Small' + s_max_size: '100' + m_label: 'PR - Medium' + m_max_size: '500' + l_label: 'PR - Large' + l_max_size: '1000' + xl_label: 'PR - XL' + fail_if_xl: 'false' + message_if_xl: > + This PR exceeds the recommended size of 1000 lines. + Please make sure you are not addressing multiple issues with one PR. + Note this PR might be rejected due to its size. + github_api_url: 'https://api.github.com' + files_to_ignore: | + "package-lock.json" + "public/lib/*" From c8fbd515540d0d7e85ffc9a60bc5e94c24803401 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Mon, 10 Mar 2025 19:53:50 +0100 Subject: [PATCH 02/26] Update stale workflow - Remove not needed "Maintainer Response" labeling - Update to latest version - Add link to source --- .github/workflows/close-stale-issues.yml | 40 +++++++----------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 1d4382592..e137a7067 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -1,4 +1,8 @@ -# Closes any issues that no longer have user interaction +# Auto-label and close any issues that no longer have user interaction + +# Close Stale Issues and PRs +# https://github.com/marketplace/actions/close-stale-issues + name: 🎯 Close Stale Issues on: @@ -11,9 +15,9 @@ jobs: runs-on: ubuntu-latest steps: - # Comment on, then close issues that haven't been updated for ages + # Comment on, then close issues that haven't been updated for ages - name: Close Stale Issues - uses: actions/stale@v4 + uses: actions/stale@v9 with: repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} days-before-stale: 183 @@ -21,7 +25,7 @@ jobs: operations-per-run: 30 remove-stale-when-updated: true enable-statistics: true - stale-issue-message: > + stale-issue-message: > This issue has gone 6 months without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 7 days. stale-pr-message: > @@ -38,8 +42,8 @@ jobs: exempt-issue-labels: 'πŸ“Œ Keep Open' exempt-pr-labels: 'πŸ“Œ Keep Open' labels-to-add-when-unstale: 'πŸ“Œ Keep Open' - - # Comment on, then close issues that required a response from the user, but didn't get one + + # Comment on, then close issues that required a response from the user, but didn't get one - name: Close Issues without Response uses: actions/stale@v4 with: @@ -53,30 +57,8 @@ jobs: Don't forget to provide this within the next few days to keep your ticket open. close-issue-message: 'Issue closed due to no response from user.' only-labels: '🚏 Awaiting User Response' - labels-to-remove-when-unstale: '🚏 Awaiting User Response, πŸ›‘ No Response' + labels-to-remove-when-unstale: '🚏 Awaiting User Response' stale-issue-label: 'πŸ›‘ No Response' close-issue-label: 'πŸ•ΈοΈ Inactive' exempt-issue-labels: 'πŸ“Œ Keep Open' exempt-pr-labels: 'πŸ“Œ Keep Open' - - # Comment on issues that we should have replied to - - name: Notify Repo Owner to Respond - uses: actions/stale@v4 - with: - repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - days-before-stale: 7 - days-before-close: 183 - operations-per-run: 30 - remove-stale-when-updated: true - stale-issue-message: Hey SillyTavern, - Don't forget to respond! - stale-pr-message: Hey SillyTavern, - Don't forget to respond! - only-labels: 'πŸ‘€ Awaiting Maintainer Response' - labels-to-remove-when-unstale: 'πŸ‘€ Awaiting Maintainer Response' - close-issue-message: 'Closed due to no response from repo author for over a year' - close-pr-message: 'Closed due to no response from repo author for over a year' - stale-issue-label: 'πŸ‘€ Awaiting Maintainer Response' - stale-pr-label: 'πŸ‘€ Awaiting Maintainer Response' - close-issue-label: 'πŸ•ΈοΈ Inactive' - close-pr-label: 'πŸ•ΈοΈ Inactive' - exempt-issue-labels: 'πŸ“Œ Keep Open' - exempt-pr-labels: 'πŸ“Œ Keep Open' From 26093c1ae4ceb4a03b81ce3f37ee26780bb5badd Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Mon, 10 Mar 2025 20:11:05 +0100 Subject: [PATCH 03/26] Update remove labels on close workflow - Added more labels that should be removed - Included PRs and their labels to be auto-removed --- ...els-closed.yml => remove-pending-labels-on-close.yml} | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename .github/workflows/{manage-pending-labels-closed.yml => remove-pending-labels-on-close.yml} (57%) diff --git a/.github/workflows/manage-pending-labels-closed.yml b/.github/workflows/remove-pending-labels-on-close.yml similarity index 57% rename from .github/workflows/manage-pending-labels-closed.yml rename to .github/workflows/remove-pending-labels-on-close.yml index 892f2f8f9..f2de08c58 100644 --- a/.github/workflows/manage-pending-labels-closed.yml +++ b/.github/workflows/remove-pending-labels-on-close.yml @@ -1,17 +1,22 @@ # When a new comment is added to an issue, if it had the Stale or Awaiting User Response labels, then those labels will be removed +# πŸ€– Issues Helper +# https://github.com/marketplace/actions/issues-helper + name: 🎯 Remove Pending Labels on Close on: issues: types: [closed] + pull_request: + types: [closed] jobs: remove-labels: runs-on: ubuntu-latest steps: - name: Remove Labels when Closed - uses: actions-cool/issues-helper@v2 + 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: '🚏 Awaiting User Response,⚰️ Stale,πŸ‘€ Awaiting Maintainer Response' \ No newline at end of file + labels: '🚏 Awaiting User Response,πŸ§‘β€πŸ’» In Progress,πŸ“Œ Keep Open,🚫 Merge Conflicts,πŸ”¬ Needs Testing,πŸ”¨ Needs Work,⚰️ Stale,β›” Waiting For External/Upstream' From a104de38b69b0290e1dc6fad1bf60cfd9fa46ef2 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Mon, 10 Mar 2025 20:11:24 +0100 Subject: [PATCH 04/26] Remove unused maintainers response workflow --- .github/workflows/manage-pending-labels.yml | 42 --------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/manage-pending-labels.yml diff --git a/.github/workflows/manage-pending-labels.yml b/.github/workflows/manage-pending-labels.yml deleted file mode 100644 index 44d91b523..000000000 --- a/.github/workflows/manage-pending-labels.yml +++ /dev/null @@ -1,42 +0,0 @@ -# When a new comment is added to an issue, if it had the Stale or Awaiting User Response labels, then those labels will be removed - -name: 🎯 Add/ Remove Awaiting Response Labels -on: - issue_comment: - types: [created] -jobs: - remove-stale: - runs-on: ubuntu-latest - if: ${{ github.event.comment.author_association != 'COLLABORATOR' && github.event.comment.author_association != 'OWNER' }} - steps: - - name: Remove Stale labels when Updated - uses: actions-cool/issues-helper@v2 - with: - actions: remove-labels - token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: '🚏 Awaiting User Response,⚰️ Stale' - - add-awaiting-author: - runs-on: ubuntu-latest - if: ${{!github.event.issue.pull_request && github.event.comment.author_association != 'COLLABORATOR' && github.event.comment.author_association != 'OWNER' && github.event.issue.state == 'open' }} - steps: - - name: Add Awaiting Author labels when Updated - uses: actions-cool/issues-helper@v2 - with: - actions: add-labels - token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: 'πŸ‘€ Awaiting Maintainer Response' - - remove-awaiting-author: - runs-on: ubuntu-latest - if: ${{ github.event.comment.author_association == 'OWNER' }} - steps: - - name: Remove Awaiting Author labels when Updated - uses: actions-cool/issues-helper@v2 - with: - actions: remove-labels - token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: 'πŸ‘€ Awaiting Maintainer Response' \ No newline at end of file From c722d251ffff55bf79cf1bf2d071a4297a732106 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Mon, 10 Mar 2025 20:33:09 +0100 Subject: [PATCH 05/26] Update merge conflicts workflow - Change the action being used - Add comment to notify PR author on merge conflicts --- .github/workflows/check-merge-conflicts.yml | 24 ++++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check-merge-conflicts.yml b/.github/workflows/check-merge-conflicts.yml index 720723558..f96152bef 100644 --- a/.github/workflows/check-merge-conflicts.yml +++ b/.github/workflows/check-merge-conflicts.yml @@ -1,17 +1,25 @@ # Detect and label pull requests that have merge conflicts + +# Label Conflicting Pull Requests +# https://github.com/marketplace/actions/label-conflicting-pull-requests + name: πŸ—οΈ Check Merge Conflicts on: + # So that PRs touching the same files as the push are updated push: - branches: - - staging + # So that the `dirtyLabel` is removed if conflicts are resolve + # We recommend `pull_request_target` so that github secrets are available. + # In `pull_request` we wouldn't be able to change labels of fork PRs + pull_request_target: + types: [synchronize] + jobs: check-conflicts: - if: github.repository == 'SillyTavern/SillyTavern' runs-on: ubuntu-latest steps: - - uses: mschilde/auto-label-merge-conflicts@master + - name: Check Merge Conflicts + uses: eps1lon/actions-label-merge-conflict@v3 with: - CONFLICT_LABEL_NAME: "🚫 Merge Conflicts" - GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - MAX_RETRIES: 5 - WAIT_MS: 5000 \ No newline at end of file + dirtyLabel: "🚫 Merge Conflicts" + repoToken: "${{ secrets.GITHUB_TOKEN }}" + commentOnDirty: "This pull request has conflicts. Please resolve them, otherwise it cannot be merged." From d6dcededc9a910fd0e8b2c01b15d5f7ce9077aeb Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Tue, 11 Mar 2025 21:43:27 +0100 Subject: [PATCH 06/26] Refactor workflows into more structured files --- .github/close-label.yml | 2 - ...-comments.yml => issues-auto-comments.yml} | 11 +-- .../{labeler.yml => issues-auto-labeler.yml} | 6 +- .github/pr-auto-comments.yml | 15 ++++ .github/workflows/add-comment-from-tag.yml | 28 -------- .github/workflows/check-merge-conflicts.yml | 25 ------- .github/workflows/get-pr-size.yml | 39 ----------- .github/workflows/issues-auto-manager.yml | 33 +++++++++ .github/workflows/issues-close-handler.yml | 20 ++++++ ...tale-issues.yml => issues-close-stale.yml} | 18 ++--- .github/workflows/labeler.yml | 19 ----- .github/workflows/pr-auto-manager.yml | 69 +++++++++++++++++++ .../remove-pending-labels-on-close.yml | 22 ------ 13 files changed, 148 insertions(+), 159 deletions(-) delete mode 100644 .github/close-label.yml rename .github/{issue-auto-comments.yml => issues-auto-comments.yml} (84%) rename .github/{labeler.yml => issues-auto-labeler.yml} (52%) create mode 100644 .github/pr-auto-comments.yml delete mode 100644 .github/workflows/add-comment-from-tag.yml delete mode 100644 .github/workflows/check-merge-conflicts.yml delete mode 100644 .github/workflows/get-pr-size.yml create mode 100644 .github/workflows/issues-auto-manager.yml create mode 100644 .github/workflows/issues-close-handler.yml rename .github/workflows/{close-stale-issues.yml => issues-close-stale.yml} (87%) delete mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/pr-auto-manager.yml delete mode 100644 .github/workflows/remove-pending-labels-on-close.yml diff --git a/.github/close-label.yml b/.github/close-label.yml deleted file mode 100644 index 5f2bfa5ee..000000000 --- a/.github/close-label.yml +++ /dev/null @@ -1,2 +0,0 @@ -πŸ› Bug: βœ… Fixed -πŸ¦„ Feature Request: βœ… Implemented \ No newline at end of file diff --git a/.github/issue-auto-comments.yml b/.github/issues-auto-comments.yml similarity index 84% rename from .github/issue-auto-comments.yml rename to .github/issues-auto-comments.yml index 8947d4e1a..a8274e818 100644 --- a/.github/issue-auto-comments.yml +++ b/.github/issues-auto-comments.yml @@ -11,9 +11,6 @@ labels: Hello @{{ issue.user.login }} your ticket has been marked as invalid. Please ensure you follow the issue template, provide all requested info, and be sure to check the docs + previous issues prior to raising tickets. - pr: - body: Thank you @{{ pull_request.user.login }} for suggesting this. Please follow the pull request templates. - action: close - name: πŸ‘©β€πŸ’» Good First Issue labeled: @@ -38,7 +35,6 @@ labels: body: > Hello @{{ issue.user.login }}! It looks like all or part of this issue has now been implemented. - - name: ‼️ High Priority labeled: issue: @@ -54,9 +50,4 @@ labels: lock_reason: spam body: > This issue has been identified as spam, and is now locked. - Users who repeatedly raise spam issues may be blocked or reported. - - - name: β›” Don't Merge - labeled: - pr: - body: This PR has been temporarily blocked from merging. \ No newline at end of file + Users who repeatedly diff --git a/.github/labeler.yml b/.github/issues-auto-labeler.yml similarity index 52% rename from .github/labeler.yml rename to .github/issues-auto-labeler.yml index 850096c9e..32f89d9d0 100644 --- a/.github/labeler.yml +++ b/.github/issues-auto-labeler.yml @@ -1,7 +1,3 @@ -# Add/remove 'critical' label if issue contains the words 'urgent' or 'critical' -#critical: -# - '(critical|urgent)' - πŸͺŸ Windows: - '(πŸͺŸ Windows)' @@ -15,4 +11,4 @@ - '(πŸ“± Termux)' 🐧 Linux: - - '(🐧 Linux)' \ No newline at end of file + - '(🐧 Linux)' diff --git a/.github/pr-auto-comments.yml b/.github/pr-auto-comments.yml new file mode 100644 index 000000000..0e4e9fe93 --- /dev/null +++ b/.github/pr-auto-comments.yml @@ -0,0 +1,15 @@ +comment: + footer: | + --- + > I am a bot, and this is an automated message πŸ€– +labels: + - name: βœ–οΈ Invalid + labeled: + pr: + body: Thank you @{{ pull_request.user.login }} for suggesting this. Please follow the pull request templates. + action: close + + - name: β›” Don't Merge + labeled: + pr: + body: This PR has been temporarily blocked from merging. diff --git a/.github/workflows/add-comment-from-tag.yml b/.github/workflows/add-comment-from-tag.yml deleted file mode 100644 index 548f83eac..000000000 --- a/.github/workflows/add-comment-from-tag.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Based on a label applied to an issue, the bot will add a comment with some additional info - -name: 🎯 Auto-Reply to Labeled Tickets -on: - issues: - types: - - labeled - - unlabeled - pull_request_target: - types: - - labeled - - unlabeled -permissions: - contents: read - issues: write - pull-requests: write - -jobs: - comment: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Label Commenter - uses: peaceiris/actions-label-commenter@v1 - with: - config_file: .github/issue-auto-comments.yml - github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/check-merge-conflicts.yml b/.github/workflows/check-merge-conflicts.yml deleted file mode 100644 index f96152bef..000000000 --- a/.github/workflows/check-merge-conflicts.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Detect and label pull requests that have merge conflicts - -# Label Conflicting Pull Requests -# https://github.com/marketplace/actions/label-conflicting-pull-requests - -name: πŸ—οΈ Check Merge Conflicts -on: - # So that PRs touching the same files as the push are updated - push: - # So that the `dirtyLabel` is removed if conflicts are resolve - # We recommend `pull_request_target` so that github secrets are available. - # In `pull_request` we wouldn't be able to change labels of fork PRs - pull_request_target: - types: [synchronize] - -jobs: - check-conflicts: - runs-on: ubuntu-latest - steps: - - name: Check Merge Conflicts - uses: eps1lon/actions-label-merge-conflict@v3 - with: - dirtyLabel: "🚫 Merge Conflicts" - repoToken: "${{ secrets.GITHUB_TOKEN }}" - commentOnDirty: "This pull request has conflicts. Please resolve them, otherwise it cannot be merged." diff --git a/.github/workflows/get-pr-size.yml b/.github/workflows/get-pr-size.yml deleted file mode 100644 index 4bc0a8f6c..000000000 --- a/.github/workflows/get-pr-size.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Adds labels to pull requests based on the size of the changes (changed lines) - -# 🏷 Pull Request Size Labeler -# https://github.com/marketplace/actions/pull-request-size-labeler - -name: 🌈 Label PR Size - -on: [pull_request] - -jobs: - labeler: - permissions: - pull-requests: write - contents: read - issues: write - runs-on: ubuntu-latest - name: Label the PR size - steps: - - uses: codelytv/pr-size-labeler@v1 - with: - GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - xs_label: 'PR - Small' - xs_max_size: '1' - s_label: 'PR - Small' - s_max_size: '100' - m_label: 'PR - Medium' - m_max_size: '500' - l_label: 'PR - Large' - l_max_size: '1000' - xl_label: 'PR - XL' - fail_if_xl: 'false' - message_if_xl: > - This PR exceeds the recommended size of 1000 lines. - Please make sure you are not addressing multiple issues with one PR. - Note this PR might be rejected due to its size. - github_api_url: 'https://api.github.com' - files_to_ignore: | - "package-lock.json" - "public/lib/*" diff --git a/.github/workflows/issues-auto-manager.yml b/.github/workflows/issues-auto-manager.yml new file mode 100644 index 000000000..d9493f20e --- /dev/null +++ b/.github/workflows/issues-auto-manager.yml @@ -0,0 +1,33 @@ +name: 🎯 Issues Auto Manager + +on: + issues: + types: [opened, edited, labeled, unlabeled] + +jobs: + manage-issues: + name: Manage Issues + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + # Checkout + # https://github.com/marketplace/actions/checkout + uses: actions/checkout@v4 + + - name: Auto-Label Issues + # Issue Labeler + # https://github.com/marketplace/actions/regex-issue-labeler + uses: github/issue-labeler@v3 + with: + configuration-path: .github/issues-auto-labeler.yml + enable-versioned-regex: 0 + repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + + - name: Post Issue Comments Based on Labels + # Label Commenter + # https://github.com/marketplace/actions/label-commenter + uses: peaceiris/actions-label-commenter@v1 + with: + config_file: .github/issues-auto-comments.yml + github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/issues-close-handler.yml b/.github/workflows/issues-close-handler.yml new file mode 100644 index 000000000..04335582c --- /dev/null +++ b/.github/workflows/issues-close-handler.yml @@ -0,0 +1,20 @@ +name: 🎯 Issues Close Handler +on: + issues: + types: [closed] + pull_request_target: + types: [closed] +jobs: + remove-labels: + name: Remove Pending Labels on Close + runs-on: ubuntu-latest + steps: + - name: Remove Pending Labels on Close + # πŸ€– 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: '🚏 Awaiting User Response,πŸ§‘β€πŸ’» In Progress,πŸ“Œ Keep Open,🚫 Merge Conflicts,πŸ”¬ Needs Testing,πŸ”¨ Needs Work,⚰️ Stale,β›” Waiting For External/Upstream' diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/issues-close-stale.yml similarity index 87% rename from .github/workflows/close-stale-issues.yml rename to .github/workflows/issues-close-stale.yml index e137a7067..0409760ab 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/issues-close-stale.yml @@ -1,8 +1,3 @@ -# Auto-label and close any issues that no longer have user interaction - -# Close Stale Issues and PRs -# https://github.com/marketplace/actions/close-stale-issues - name: 🎯 Close Stale Issues on: @@ -11,12 +6,15 @@ on: - cron: '0 0 * * *' # Runs every day at midnight UTC jobs: - stale: + close-stale: + name: Close Stale Issues runs-on: ubuntu-latest steps: # Comment on, then close issues that haven't been updated for ages - - name: Close Stale Issues + - name: Mark Issues without Activity + # Close Stale Issues and PRs + # https://github.com/marketplace/actions/close-stale-issues uses: actions/stale@v9 with: repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} @@ -44,8 +42,10 @@ jobs: labels-to-add-when-unstale: 'πŸ“Œ Keep Open' # Comment on, then close issues that required a response from the user, but didn't get one - - name: Close Issues without Response - uses: actions/stale@v4 + - name: Mark Issues with Requested Response + # Close Stale Issues and PRs + # https://github.com/marketplace/actions/close-stale-issues + uses: actions/stale@v9 with: repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} days-before-stale: 7 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index 554c588b8..000000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: "Issue Labeler" -on: - issues: - types: [opened, edited] - -permissions: - issues: write - contents: read - -jobs: - triage: - runs-on: ubuntu-latest - steps: - - uses: github/issue-labeler@v3.4 - with: - configuration-path: .github/labeler.yml -# not-before: 2020-01-15T02:54:32Z # optional and will result in any issues prior to this timestamp to be ignored. - enable-versioned-regex: 0 - repo-token: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml new file mode 100644 index 000000000..53762a242 --- /dev/null +++ b/.github/workflows/pr-auto-manager.yml @@ -0,0 +1,69 @@ +name: 🎯 Pull Request Auto Manager + +on: + pull_request_target: + types: [opened, synchronize, reopened, edited, labeled, unlabeled] + +jobs: + check-merge-conflicts: + name: Check Merge Conflicts + runs-on: ubuntu-latest + + steps: + - name: Check Merge Conflicts + # Label Conflicting Pull Requests + # https://github.com/marketplace/actions/label-conflicting-pull-requests + uses: eps1lon/actions-label-merge-conflict@v3 + with: + dirtyLabel: '🚫 Merge Conflicts' + repoToken: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + commentOnDirty: "This pull request has conflicts. Please resolve them, otherwise it cannot be merged." + + pr-size-labeler: + name: Label PR Size + runs-on: ubuntu-latest + + steps: + - name: Label PR Size + # Pull Request Size Labeler + # https://github.com/marketplace/actions/pull-request-size-labeler + uses: codelytv/pr-size-labeler@v1 + with: + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + xs_label: 'PR - Small' + xs_max_size: '1' + s_label: 'PR - Small' + s_max_size: '100' + m_label: 'PR - Medium' + m_max_size: '500' + l_label: 'PR - Large' + l_max_size: '1000' + xl_label: 'PR - XL' + fail_if_xl: 'false' + message_if_xl: > + This PR exceeds the recommended size of 1000 lines. + Please ensure you are not addressing multiple issues in one PR. + Note this PR might be rejected due to its size. + github_api_url: 'https://api.github.com' + files_to_ignore: | + "package-lock.json" + "public/lib/*" + + pr-auto-comments: + name: Post PR Comments Based on Labels + needs: [check-merge-conflicts, pr-size-labeler] + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + # Checkout + # https://github.com/marketplace/actions/checkout + uses: actions/checkout@v4 + + - name: Post PR Comments Based on Labels + # Label Commenter for PRs + # https://github.com/marketplace/actions/label-commenter + uses: peaceiris/actions-label-commenter@v1 + with: + config_file: .github/pr-auto-comments.yml + github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/remove-pending-labels-on-close.yml b/.github/workflows/remove-pending-labels-on-close.yml deleted file mode 100644 index f2de08c58..000000000 --- a/.github/workflows/remove-pending-labels-on-close.yml +++ /dev/null @@ -1,22 +0,0 @@ -# When a new comment is added to an issue, if it had the Stale or Awaiting User Response labels, then those labels will be removed - -# πŸ€– Issues Helper -# https://github.com/marketplace/actions/issues-helper - -name: 🎯 Remove Pending Labels on Close -on: - issues: - types: [closed] - pull_request: - types: [closed] -jobs: - remove-labels: - runs-on: ubuntu-latest - steps: - - name: Remove Labels when Closed - 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: '🚏 Awaiting User Response,πŸ§‘β€πŸ’» In Progress,πŸ“Œ Keep Open,🚫 Merge Conflicts,πŸ”¬ Needs Testing,πŸ”¨ Needs Work,⚰️ Stale,β›” Waiting For External/Upstream' From 26c4d231a8c6310fd7afd72bbc11d475cd72c722 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Tue, 11 Mar 2025 23:43:35 +0100 Subject: [PATCH 07/26] "add Maintainer label" job via on open workflow --- ...es-close-stale.yml => job-close-stale.yml} | 7 ++- ...close-handler.yml => on-close-handler.yml} | 5 +- .github/workflows/on-open-handler.yml | 50 +++++++++++++++++++ 3 files changed, 57 insertions(+), 5 deletions(-) rename .github/workflows/{issues-close-stale.yml => job-close-stale.yml} (94%) rename .github/workflows/{issues-close-handler.yml => on-close-handler.yml} (94%) create mode 100644 .github/workflows/on-open-handler.yml diff --git a/.github/workflows/issues-close-stale.yml b/.github/workflows/job-close-stale.yml similarity index 94% rename from .github/workflows/issues-close-stale.yml rename to .github/workflows/job-close-stale.yml index 0409760ab..fa9c83cf6 100644 --- a/.github/workflows/issues-close-stale.yml +++ b/.github/workflows/job-close-stale.yml @@ -1,4 +1,4 @@ -name: 🎯 Close Stale Issues +name: 🎯 Close Stale Issues/PRs Job on: workflow_dispatch: @@ -7,12 +7,12 @@ on: jobs: close-stale: - name: Close Stale Issues + name: Close Stale Issues/PRs Job runs-on: ubuntu-latest steps: # Comment on, then close issues that haven't been updated for ages - - name: Mark Issues without Activity + - name: Mark Issues/PRs without Activity # Close Stale Issues and PRs # https://github.com/marketplace/actions/close-stale-issues uses: actions/stale@v9 @@ -61,4 +61,3 @@ jobs: stale-issue-label: 'πŸ›‘ No Response' close-issue-label: 'πŸ•ΈοΈ Inactive' exempt-issue-labels: 'πŸ“Œ Keep Open' - exempt-pr-labels: 'πŸ“Œ Keep Open' diff --git a/.github/workflows/issues-close-handler.yml b/.github/workflows/on-close-handler.yml similarity index 94% rename from .github/workflows/issues-close-handler.yml rename to .github/workflows/on-close-handler.yml index 04335582c..cc0cd3292 100644 --- a/.github/workflows/issues-close-handler.yml +++ b/.github/workflows/on-close-handler.yml @@ -1,13 +1,16 @@ -name: 🎯 Issues Close Handler +name: 🎯 Issues/PRs On Close Handler + on: issues: types: [closed] pull_request_target: types: [closed] + jobs: remove-labels: name: Remove Pending Labels on Close runs-on: ubuntu-latest + steps: - name: Remove Pending Labels on Close # πŸ€– Issues Helper diff --git a/.github/workflows/on-open-handler.yml b/.github/workflows/on-open-handler.yml new file mode 100644 index 000000000..33327fbca --- /dev/null +++ b/.github/workflows/on-open-handler.yml @@ -0,0 +1,50 @@ +name: 🎯 Issues/PRs Open Handler + +on: + issues: + types: [opened] + pull_request_target: + types: [opened] + +jobs: + label-maintainer: + name: Label if Author is a Repo Maintainer + runs-on: ubuntu-latest + + steps: + - name: Label if Author is a Repo Maintainer + # GitHub Script + # https://github.com/marketplace/actions/github-script + uses: actions/github-script@v6 + with: + script: | + // Get basic info + const { owner, repo } = context.repo; + const payload = context.payload; + // Determine if it's an issue or a pull request + const eventData = payload.issue || payload.pull_request; + const username = eventData.user.login; + const issue_number = eventData.number; + + // Get the collaborator permission level for the user + const { data: permissionData } = await github.repos.getCollaboratorPermissionLevel({ + owner, + repo, + username, + }); + + const permission = permissionData.permission; + console.log(`User ${username} has permission level: ${permission}`); + + // Check if user is an admin or has maintain permissions + if (['admin', 'maintain'].includes(permission)) { + console.log(`Adding "Maintainer" label to issue/PR #${issue_number}`); + await github.issues.addLabels({ + owner, + repo, + issue_number, + labels: ['Maintainer'], + }); + } else { + console.log(`User ${username} is not a repo maintainer.`); + } From c22ad7c2e802b11280b2e63d9e6f341032e1e80e Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 12 Mar 2025 00:06:33 +0100 Subject: [PATCH 08/26] auto ask for feedback on "Alternative Exists" --- .github/workflows/job-close-stale.yml | 48 +++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/.github/workflows/job-close-stale.yml b/.github/workflows/job-close-stale.yml index fa9c83cf6..a59525c30 100644 --- a/.github/workflows/job-close-stale.yml +++ b/.github/workflows/job-close-stale.yml @@ -1,17 +1,18 @@ -name: 🎯 Close Stale Issues/PRs Job +name: 🎯 Close Stale Issues/PRs Workflow on: workflow_dispatch: schedule: - cron: '0 0 * * *' # Runs every day at midnight UTC + issues: + types: [labeled, unlabeled, edited] jobs: - close-stale: - name: Close Stale Issues/PRs Job + mark-inactivity: + name: Mark Issues/PRs without Activity runs-on: ubuntu-latest steps: - # Comment on, then close issues that haven't been updated for ages - name: Mark Issues/PRs without Activity # Close Stale Issues and PRs # https://github.com/marketplace/actions/close-stale-issues @@ -41,8 +42,13 @@ jobs: exempt-pr-labels: 'πŸ“Œ Keep Open' labels-to-add-when-unstale: 'πŸ“Œ Keep Open' - # Comment on, then close issues that required a response from the user, but didn't get one - - name: Mark Issues with Requested Response + await-user-response: + name: Mark Issues/PRs Awaiting User Response + runs-on: ubuntu-latest + needs: mark-inactivity + + steps: + - name: Mark Issues/PRs Awaiting User Response # Close Stale Issues and PRs # https://github.com/marketplace/actions/close-stale-issues uses: actions/stale@v9 @@ -55,9 +61,37 @@ jobs: stale-issue-message: > Hi! Looks like additional info is required for this issue to be addressed. Don't forget to provide this within the next few days to keep your ticket open. - close-issue-message: 'Issue closed due to no response from user.' + close-issue-message: > + Issue closed due to no response from user. only-labels: '🚏 Awaiting User Response' labels-to-remove-when-unstale: '🚏 Awaiting User Response' stale-issue-label: 'πŸ›‘ No Response' close-issue-label: 'πŸ•ΈοΈ Inactive' + exempt-issue-labels: 'πŸ“Œ Keep Open,🚧 Alternative Exists' + + alternative-exists: + name: Mark Issues with Alternative Exists + runs-on: ubuntu-latest + needs: await-user-response + + steps: + - name: Mark Issues with Alternative Exists + # Close Stale Issues and PRs + # https://github.com/marketplace/actions/close-stale-issues + uses: actions/stale@v9 + with: + repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + days-before-stale: 7 + days-before-close: 7 + operations-per-run: 30 + remove-stale-when-updated: true + stale-issue-message: > + This issue was marked as having an alternative solution available. Did this help you out, and this issue can be closed? + Please confirm by commenting to keep it open, otherwise it will be closed in 7 days. + close-issue-message: > + Issue closed automatically due to no confirmation regarding the alternative solution. + only-labels: '🚧 Alternative Exists' + stale-issue-label: '🚏 Awaiting User Response' + close-issue-label: 'πŸ•ΈοΈ Inactive' exempt-issue-labels: 'πŸ“Œ Keep Open' + labels-to-add-when-unstale: 'πŸ“Œ Keep Open' From 0237b6a872fb0be1ed460a9c57fc2244b2e69bd6 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 12 Mar 2025 00:59:23 +0100 Subject: [PATCH 09/26] Auto-comment/label issues once on staging --- .github/workflows/issues-auto-manager.yml | 2 +- .github/workflows/pr-auto-manager.yml | 39 ++++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/workflows/issues-auto-manager.yml b/.github/workflows/issues-auto-manager.yml index d9493f20e..72f1c8ca9 100644 --- a/.github/workflows/issues-auto-manager.yml +++ b/.github/workflows/issues-auto-manager.yml @@ -15,7 +15,7 @@ jobs: # https://github.com/marketplace/actions/checkout uses: actions/checkout@v4 - - name: Auto-Label Issues + - name: Auto-Label Issues (Based on Issue Content) # Issue Labeler # https://github.com/marketplace/actions/regex-issue-labeler uses: github/issue-labeler@v3 diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml index 53762a242..83e3bf51b 100644 --- a/.github/workflows/pr-auto-manager.yml +++ b/.github/workflows/pr-auto-manager.yml @@ -2,7 +2,7 @@ name: 🎯 Pull Request Auto Manager on: pull_request_target: - types: [opened, synchronize, reopened, edited, labeled, unlabeled] + types: [opened, synchronize, reopened, edited, labeled, unlabeled, closed] jobs: check-merge-conflicts: @@ -67,3 +67,40 @@ jobs: with: config_file: .github/pr-auto-comments.yml github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + + update-linked-issues: + name: Update Issues on Staging Merge + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'staging' + + steps: + - name: Extract Linked Issues + id: extract_issues + run: | + ISSUES=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH" | grep -oiE '(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved) #([0-9]+)' | awk '{print $2}' | tr -d '#' | jq -R -s -c 'split("\n")[:-1]') + echo "issues=$ISSUES" >> $GITHUB_ENV + + - name: Fetch Directly Linked Issues + id: fetch_linked_issues + run: | + PR_NUMBER=${{ github.event.pull_request.number }} + REPO=${{ github.repository }} + API_URL="https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/issues" + ISSUES=$(curl -s -H "Authorization: token ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}" "$API_URL" | jq -r '.[].number' | jq -R -s -c 'split("\n")[:-1]') + echo "linked_issues=$ISSUES" >> $GITHUB_ENV + + - name: Merge Issue Lists + id: merge_issues + run: | + ISSUES=$(jq -c -n --argjson a "$issues" --argjson b "$linked_issues" '$a + $b | unique') + echo "final_issues=$ISSUES" >> $GITHUB_ENV + + - name: Comment and Label Issues + env: + GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + run: | + for ISSUE in $(echo $final_issues | jq -r '.[]'); do + echo "Updating issue #$ISSUE" + gh issue edit $ISSUE -R ${{ github.repository }} --add-label "βœ… Done (staging)" + gh issue comment $ISSUE -R ${{ github.repository }} -b "This issue is now available in the \`staging\` branch for testing. Please verify and let us know any feedback!" + done From 89ab1388825c035acb81a189820a3f7d1a0ae672 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 12 Mar 2025 01:55:37 +0100 Subject: [PATCH 10/26] Auto-label PRs based on files + targeting release --- ...uto-labeler.yml => issues-auto-labels.yml} | 0 .github/pr-auto-labels,yml | 29 +++++++++++++++++++ .github/workflows/issues-auto-manager.yml | 2 +- .github/workflows/pr-auto-manager.yml | 26 ++++++++++++++++- 4 files changed, 55 insertions(+), 2 deletions(-) rename .github/{issues-auto-labeler.yml => issues-auto-labels.yml} (100%) create mode 100644 .github/pr-auto-labels,yml diff --git a/.github/issues-auto-labeler.yml b/.github/issues-auto-labels.yml similarity index 100% rename from .github/issues-auto-labeler.yml rename to .github/issues-auto-labels.yml diff --git a/.github/pr-auto-labels,yml b/.github/pr-auto-labels,yml new file mode 100644 index 000000000..1e94c18da --- /dev/null +++ b/.github/pr-auto-labels,yml @@ -0,0 +1,29 @@ +🏭 Backend Changes: + - "src/**" + - "server.js" + - "plugins.js" + - "recover.js" + - "webpack.config.js" + - "Start.bat" + - "start.sh" + - "UpdateAndStart.bat" + - "UpdateForkAndStart.bat" + +πŸ› οΈ Build Changes: + - ".github/workflows/**" + - "docker/**" + - ".dockerignore" + - "Dockerfile" + - "webpack.config.js" + +🌐 Language: + - "public/locales/**" + +πŸ“₯ Dependencies: + - "public/lib/**" # Every frontend lib counts as a dependency as well + - "package.json" + - "package-lock.json" + - "tests/package.json" + - "tests/package-lock.json" + - "src/electron/package.json" + - "src/electron/package-lock.json" diff --git a/.github/workflows/issues-auto-manager.yml b/.github/workflows/issues-auto-manager.yml index 72f1c8ca9..00b67258e 100644 --- a/.github/workflows/issues-auto-manager.yml +++ b/.github/workflows/issues-auto-manager.yml @@ -20,7 +20,7 @@ jobs: # https://github.com/marketplace/actions/regex-issue-labeler uses: github/issue-labeler@v3 with: - configuration-path: .github/issues-auto-labeler.yml + configuration-path: .github/issues-auto-labels.yml enable-versioned-regex: 0 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml index 83e3bf51b..03ef5884e 100644 --- a/.github/workflows/pr-auto-manager.yml +++ b/.github/workflows/pr-auto-manager.yml @@ -20,7 +20,7 @@ jobs: commentOnDirty: "This pull request has conflicts. Please resolve them, otherwise it cannot be merged." pr-size-labeler: - name: Label PR Size + name: Apply Label for PR Size runs-on: ubuntu-latest steps: @@ -49,6 +49,30 @@ jobs: "package-lock.json" "public/lib/*" + label-release-prs: + name: Label PRs Targeting Release Branch + runs-on: ubuntu-latest + + steps: + - name: Label PRs Targeting Release Branch + if: github.base_ref == 'release' + run: | + gh pr edit ${{ github.event.pull_request.number }} --add-label "❗ Against Release Branch" + env: + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + + apply-file-based-labels: + name: Apply Labels Based on Changed Files + runs-on: ubuntu-latest + + steps: + - name: Apply Labels Based on Changed Files + # Pull Request Labeler + # https://github.com/marketplace/actions/labeler + uses: actions/labeler@v5 + with: + repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + pr-auto-comments: name: Post PR Comments Based on Labels needs: [check-merge-conflicts, pr-size-labeler] From 7543a24ca720e7ef13484400ffcdbad1d08b1c44 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 12 Mar 2025 02:44:24 +0100 Subject: [PATCH 11/26] Rewrite and expand auto comments --- .github/issues-auto-comments.yml | 39 ++++++++++++++++++++------------ .github/pr-auto-comments.yml | 30 +++++++++++++++++++++--- 2 files changed, 52 insertions(+), 17 deletions(-) diff --git a/.github/issues-auto-comments.yml b/.github/issues-auto-comments.yml index a8274e818..f73c2d2a3 100644 --- a/.github/issues-auto-comments.yml +++ b/.github/issues-auto-comments.yml @@ -1,5 +1,5 @@ comment: - footer: | + footer: > --- > I am a bot, and this is an automated message πŸ€– labels: @@ -8,7 +8,7 @@ labels: issue: action: close body: > - Hello @{{ issue.user.login }} your ticket has been marked as invalid. + Hello @{{ issue.user.login }}. Your ticket has been marked as invalid. Please ensure you follow the issue template, provide all requested info, and be sure to check the docs + previous issues prior to raising tickets. @@ -16,31 +16,42 @@ labels: labeled: issue: body: > - This issue has been marked as a good first issue for first-time contributors to implement! - This is a great way to support the project, while also improving your skills, you'll also be credited as a contributor once your PR is merged. - If you're new to SillyTavern [here are a collection of resources](https://docs.sillytavern.app/) - If you need any support at all, feel free to reach out via [Discord](https://discord.gg/sillytavern). + This issue has been marked as a good first issue for contributors to implement! + This is a great way to support the project. While also improving your skills, you'll also be credited as a contributor once your PR is merged. + If you're new to SillyTavern [here is the official documentation](https://docs.sillytavern.app/). The official contribution guide can be found [here](https://github.com/SillyTavern/SillyTavern/blob/release/CONTRIBUTING.md). + If you need any support at all, feel free to reach out via [Discord](https://discord.gg/sillytavern), or let us know in this issue or via [discussions](https://github.com/SillyTavern/SillyTavern/discussions). - name: ❌ wontfix labeled: issue: action: close body: > - This ticked has been marked as 'wontfix', which usually means it is out-of-scope, or not feasible at this time. - You can still fork the project and make the changes yourself. + This ticket has been marked as 'wontfix', which usually means it is out-of-scope, or not feasible at this time. + IF you have any questions about this, feel free to reach out. - - name: βœ… Fixed + - name: βœ… Done (staging) labeled: issue: body: > - Hello @{{ issue.user.login }}! It looks like all or part of this issue has now been implemented. + It looks like all or part of this issue has now been implemented as part of the `staging` branch. + If you currently are on the `release` branch, you can switch to `staging` to test this right away. + + Note that `staging` is considered less stable than the official releases. To switch, follow existing instructions, + or simply enter the following command: `git switch staging` + + - name: βœ… Done + labeled: + issue: + body: > + It looks like all or part of this issue has now been implemented as part of the `latest` release. - name: ‼️ High Priority labeled: issue: body: > - This ticket has been marked as high priority, and has been bumped to the top of the priority list. - You should expect an implementation to be pushed out soon. Thank you for your patience. + This issue has been marked as high priority, indicating that it is important to the maintainers and the community. + While we cannot guarantee an immediate fix or provide an exact timeline, please rest assured that it is on our radar and will be addressed whenever possible. + Thank you for your patience and understanding. - name: πŸ’€ Spam labeled: @@ -49,5 +60,5 @@ labels: locking: lock lock_reason: spam body: > - This issue has been identified as spam, and is now locked. - Users who repeatedly + This issue has been identified as spam, and is now locked. + Please refrain from posting spam in the future, as it disrupts the community and wastes valuable time. diff --git a/.github/pr-auto-comments.yml b/.github/pr-auto-comments.yml index 0e4e9fe93..be935b098 100644 --- a/.github/pr-auto-comments.yml +++ b/.github/pr-auto-comments.yml @@ -1,15 +1,39 @@ comment: - footer: | + footer: > --- > I am a bot, and this is an automated message πŸ€– labels: - name: βœ–οΈ Invalid labeled: pr: - body: Thank you @{{ pull_request.user.login }} for suggesting this. Please follow the pull request templates. action: close + body: > + Thank you @{{ pull_request.user.login }} for contributing to this repository. + Your Pull Request has been marked as invalid. + + Please ensure you follow the pull request template, provide all relevant info, + and target the correct branch. `staging` is the default target branch, `release` should only be targeted for important hotfixes. + + If you have any questions, feel free to reach out. - name: β›” Don't Merge labeled: pr: - body: This PR has been temporarily blocked from merging. + body: > + This PR has been temporarily blocked from merging. + + - name: πŸ’₯πŸ’£ Breaking Changes + labeled: + pr: + body: > + This PR is marked as containing one or more breaking changes. + + Please make sure that those are documented accordingly and steps to inform users at release are prepared. + + - name: β›” Waiting For External/Upstream + labeled: + pr: + body: > + This PR is awaiting external or upstream changes or approval. + It can only be merged once those changes have been implemented and approved. + Please inform us of any progress on the upstream changes or approval. From f6f87f6d5b5017a838d6e3a96cdc29d7ccdd47d8 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 12 Mar 2025 02:56:38 +0100 Subject: [PATCH 12/26] unstale issues/prs on comments right away --- .github/workflows/job-close-stale.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/job-close-stale.yml b/.github/workflows/job-close-stale.yml index a59525c30..e44bf87b0 100644 --- a/.github/workflows/job-close-stale.yml +++ b/.github/workflows/job-close-stale.yml @@ -4,8 +4,9 @@ on: workflow_dispatch: schedule: - cron: '0 0 * * *' # Runs every day at midnight UTC - issues: - types: [labeled, unlabeled, edited] + issue_comment: + types: [created] + jobs: mark-inactivity: From fc151284e4b4b3c8ced5d7ff4576b172e275e3b3 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 12 Mar 2025 03:21:23 +0100 Subject: [PATCH 13/26] update labels based on other labels --- .github/workflows/issues-auto-manager.yml | 52 ++++++++++++++++++++--- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/.github/workflows/issues-auto-manager.yml b/.github/workflows/issues-auto-manager.yml index 00b67258e..c775dac37 100644 --- a/.github/workflows/issues-auto-manager.yml +++ b/.github/workflows/issues-auto-manager.yml @@ -5,16 +5,11 @@ on: types: [opened, edited, labeled, unlabeled] jobs: - manage-issues: - name: Manage Issues + issue-label-on-content: + name: Auto-Label Issues (Based on Issue Content) runs-on: ubuntu-latest steps: - - name: Checkout Repository - # Checkout - # https://github.com/marketplace/actions/checkout - uses: actions/checkout@v4 - - name: Auto-Label Issues (Based on Issue Content) # Issue Labeler # https://github.com/marketplace/actions/regex-issue-labeler @@ -24,6 +19,49 @@ jobs: enable-versioned-regex: 0 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + issue-label-on-labels: + name: Auto-Label Issues (Based on Issue Labels) + runs-on: ubuntu-latest + + steps: + # βœ… Auto-Add "πŸ‘ Approved / Nice-to-Have" when specific labels are added + - name: Add "πŸ‘ Approved / Nice-to-Have" for relevant labels + if: contains(fromJSON('["πŸ‘©β€πŸ’» Good First Issue", "πŸ™ Help Wanted", "πŸͺ² Confirmed", "⚠️ High Priority", "❕ Medium Priority", "πŸ’€ Low Priority"]'), github.event.label.name) + uses: actions-cool/issues-helper@v3 + with: + actions: 'add-labels' + token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + labels: 'πŸ‘ Approved / Nice-to-Have' + + # ❌ Remove "πŸ§‘β€πŸ’» In Progress" when specific labels are added + - name: Remove "πŸ§‘β€πŸ’» In Progress" when PR is marked done or stale + if: contains(fromJSON('["βœ… Done", "βœ… Done (staging)", "⚰️ Stale", "❌ wontfix"]'), github.event.label.name) + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-labels' + token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + labels: 'πŸ§‘β€πŸ’» In Progress' + + # ❌ Remove "πŸ€” Unsure" and "πŸ€” Under Consideration" when "❌ wontfix" is added + - name: Remove "πŸ€” Unsure" and "πŸ€” Under Consideration" when "❌ wontfix" is added + if: github.event.label.name == '❌ wontfix' + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-labels' + token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + labels: 'πŸ€” Unsure,πŸ€” Under Consideration' + + issue-auto-comments: + name: Post Issue Comments Based on Labels + needs: [issue-label-on-content, issue-label-on-labels] + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + # Checkout + # https://github.com/marketplace/actions/checkout + uses: actions/checkout@v4 + - name: Post Issue Comments Based on Labels # Label Commenter # https://github.com/marketplace/actions/label-commenter From 843bd1cf3cbc7b74246e244b5a99dd845a1729cd Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 12 Mar 2025 04:02:14 +0100 Subject: [PATCH 14/26] Add check for PRs with merge-blocking labels --- .github/workflows/on-open-handler.yml | 2 +- .github/workflows/pr-auto-manager.yml | 44 ++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-open-handler.yml b/.github/workflows/on-open-handler.yml index 33327fbca..e4bab4a04 100644 --- a/.github/workflows/on-open-handler.yml +++ b/.github/workflows/on-open-handler.yml @@ -15,7 +15,7 @@ jobs: - name: Label if Author is a Repo Maintainer # GitHub Script # https://github.com/marketplace/actions/github-script - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | // Get basic info diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml index 03ef5884e..1b733521f 100644 --- a/.github/workflows/pr-auto-manager.yml +++ b/.github/workflows/pr-auto-manager.yml @@ -73,9 +73,51 @@ jobs: with: repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + check-merge-blocking-labels: + name: Check Merge Blocking Labels + needs: [check-merge-conflicts, pr-size-labeler, label-release-prs, apply-file-based-labels] + runs-on: ubuntu-latest + + steps: + - name: Check Merge Blocking + # GitHub Script + # https://github.com/marketplace/actions/github-scriptLabels + id: label-check + uses: actions/github-script@v7 + with: + script: | + const prLabels = context.payload.pull_request.labels.map(label => label.name); + const blockingLabels = [ + "β›” Don't Merge", + "πŸ”¨ Needs Work", + "πŸ”¬ Needs Testing", + "β›” Waiting For External/Upstream", + "❗ Against Release Branch", + "πŸ’₯πŸ’£ Breaking Changes" + ]; + const hasBlockingLabel = prLabels.some(label => blockingLabels.includes(label)); + + if (hasBlockingLabel) { + console.log("Blocking label detected. Setting warning status."); + await github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: "PR Label Warning", + head_sha: context.payload.pull_request.head.sha, + status: "completed", + conclusion: "neutral", + output: { + title: "Potential Merge Issue", + summary: "This PR has a merge-blocking label. Proceed with caution." + } + }); + } else { + console.log("No merge-blocking labels found."); + } + pr-auto-comments: name: Post PR Comments Based on Labels - needs: [check-merge-conflicts, pr-size-labeler] + needs: [check-merge-conflicts, pr-size-labeler, label-release-prs, apply-file-based-labels] runs-on: ubuntu-latest steps: From 34363e6875b907983f64f2fb3ea2268dfae59ab6 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Thu, 13 Mar 2025 11:38:40 +0100 Subject: [PATCH 15/26] Add issue types to issue templates --- .github/ISSUE_TEMPLATE/bug-report.yml | 1 + .github/ISSUE_TEMPLATE/feature-request.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 10734f74e..1ff252a65 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,4 +1,5 @@ name: Bug Report πŸ› +type: Bug description: Report something that's not working the intended way. Support requests for external programs (reverse proxies, 3rd party servers, other peoples' forks) will be refused! Please use English only. title: '[BUG] ' labels: ['πŸ› Bug'] diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 088a8acf3..04d02e23a 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,4 +1,5 @@ name: Feature Request ✨ +type: Feature description: Suggest an idea for future development of this project. Please use English only. title: '[FEATURE_REQUEST] <title>' labels: ['πŸ¦„ Feature Request'] @@ -32,7 +33,7 @@ body: id: solution attributes: label: Describe the solution you'd like - placeholder: An outline of how you would like this to be implemented, include as much details as possible + placeholder: An outline of how you would like this to be implemented, include as much details as possible validations: required: true From e43b9a3d2ce4b637f4a3c0cc8b77e0c8efb673c7 Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 12:08:17 +0100 Subject: [PATCH 16/26] Rework auto labels based on labels a bit --- .github/workflows/issues-auto-manager.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/issues-auto-manager.yml b/.github/workflows/issues-auto-manager.yml index c775dac37..3008f4b53 100644 --- a/.github/workflows/issues-auto-manager.yml +++ b/.github/workflows/issues-auto-manager.yml @@ -24,33 +24,38 @@ jobs: runs-on: ubuntu-latest steps: - # βœ… Auto-Add "πŸ‘ Approved / Nice-to-Have" when specific labels are added - - name: Add "πŸ‘ Approved / Nice-to-Have" for relevant labels + - name: βœ… Add "πŸ‘ Approved" for relevant labels if: contains(fromJSON('["πŸ‘©β€πŸ’» Good First Issue", "πŸ™ Help Wanted", "πŸͺ² Confirmed", "⚠️ High Priority", "❕ Medium Priority", "πŸ’€ Low Priority"]'), github.event.label.name) uses: actions-cool/issues-helper@v3 with: actions: 'add-labels' token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - labels: 'πŸ‘ Approved / Nice-to-Have' + labels: 'πŸ‘ Approved' - # ❌ Remove "πŸ§‘β€πŸ’» In Progress" when specific labels are added - - name: Remove "πŸ§‘β€πŸ’» In Progress" when PR is marked done or stale + - name: ❌ Remove progress labels when PR/issue is marked done or stale if: contains(fromJSON('["βœ… Done", "βœ… Done (staging)", "⚰️ Stale", "❌ wontfix"]'), github.event.label.name) uses: actions-cool/issues-helper@v3 with: actions: 'remove-labels' token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - labels: 'πŸ§‘β€πŸ’» In Progress' + labels: 'πŸ§‘β€πŸ’» In Progress,πŸ€” Unsure,πŸ€” Under Consideration' - # ❌ Remove "πŸ€” Unsure" and "πŸ€” Under Consideration" when "❌ wontfix" is added - - name: Remove "πŸ€” Unsure" and "πŸ€” Under Consideration" when "❌ wontfix" is added - if: github.event.label.name == '❌ wontfix' + - name: ❌ Remove temporary labels when confirmed labels are added + if: contains(fromJSON('["❌ wontfix","πŸ‘ Approved","πŸ‘©β€πŸ’» Good First Issue"]'), github.event.label.name) uses: actions-cool/issues-helper@v3 with: actions: 'remove-labels' token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} labels: 'πŸ€” Unsure,πŸ€” Under Consideration' + - name: ❌ Remove no bug labels when "πŸͺ² Confirmed" is added + if: github.event.label.name == 'πŸͺ² Confirmed' + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-labels' + token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + labels: 'βœ–οΈ Not Reproducible,βœ–οΈ Not A Bug' + issue-auto-comments: name: Post Issue Comments Based on Labels needs: [issue-label-on-content, issue-label-on-labels] From 5f726d2b2516269f55271885c82a8360dfac0b40 Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 12:08:49 +0100 Subject: [PATCH 17/26] A bit more auto-labeling on issue open --- .github/issues-auto-labels.yml | 6 ++++++ .github/workflows/issues-auto-manager.yml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/.github/issues-auto-labels.yml b/.github/issues-auto-labels.yml index 32f89d9d0..8bfb62009 100644 --- a/.github/issues-auto-labels.yml +++ b/.github/issues-auto-labels.yml @@ -12,3 +12,9 @@ 🐧 Linux: - '(🐧 Linux)' + +🦊 Firefox: + - '(firefox|mozilla)' + +πŸ“± Mobile: + - '(iphone|ios|android|πŸ“± Termux)' diff --git a/.github/workflows/issues-auto-manager.yml b/.github/workflows/issues-auto-manager.yml index 3008f4b53..8d577ac3f 100644 --- a/.github/workflows/issues-auto-manager.yml +++ b/.github/workflows/issues-auto-manager.yml @@ -11,6 +11,9 @@ jobs: steps: - name: Auto-Label Issues (Based on Issue Content) + # only auto label based on issue content once, on open (to prevent re-labeling removed labels) + if: github.event.action == 'opened' + # Issue Labeler # https://github.com/marketplace/actions/regex-issue-labeler uses: github/issue-labeler@v3 From 4f7695b0ce0575260ee606d723af22736e0f6896 Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 16:28:28 +0100 Subject: [PATCH 18/26] Update auto comments to make them more uniform --- .github/issues-auto-comments.yml | 41 +++++++++++++++------------ .github/pr-auto-comments.yml | 30 +++++++++++--------- .github/workflows/job-close-stale.yml | 25 ++++++++-------- .github/workflows/pr-auto-manager.yml | 10 +++---- 4 files changed, 58 insertions(+), 48 deletions(-) diff --git a/.github/issues-auto-comments.yml b/.github/issues-auto-comments.yml index f73c2d2a3..9c412ffd8 100644 --- a/.github/issues-auto-comments.yml +++ b/.github/issues-auto-comments.yml @@ -1,39 +1,45 @@ -comment: - footer: > - --- - > I am a bot, and this is an automated message πŸ€– labels: - name: βœ–οΈ Invalid labeled: issue: action: close body: > - Hello @{{ issue.user.login }}. Your ticket has been marked as invalid. - Please ensure you follow the issue template, provide all requested info, - and be sure to check the docs + previous issues prior to raising tickets. + Hey @{{ issue.user.login }}, this issue has been marked as invalid. + + Please double-check that you've followed the issue template, included all necessary details, and reviewed the docs & previous issues before submitting. + If provided, follow the instructions given by maintainers. - name: πŸ‘©β€πŸ’» Good First Issue labeled: issue: body: > - This issue has been marked as a good first issue for contributors to implement! + πŸ† This issue has been marked as a good first issue for contributors to implement! This is a great way to support the project. While also improving your skills, you'll also be credited as a contributor once your PR is merged. + If you're new to SillyTavern [here is the official documentation](https://docs.sillytavern.app/). The official contribution guide can be found [here](https://github.com/SillyTavern/SillyTavern/blob/release/CONTRIBUTING.md). - If you need any support at all, feel free to reach out via [Discord](https://discord.gg/sillytavern), or let us know in this issue or via [discussions](https://github.com/SillyTavern/SillyTavern/discussions). + If you need any support, feel free to reach out via [Discord](https://discord.gg/sillytavern), or let us know in this issue or via [discussions](https://github.com/SillyTavern/SillyTavern/discussions). - name: ❌ wontfix labeled: issue: action: close body: > - This ticket has been marked as 'wontfix', which usually means it is out-of-scope, or not feasible at this time. - IF you have any questions about this, feel free to reach out. + ❌ This issue has been marked as 'wontfix', which usually means it is out-of-scope, not feasible at this time or will not be implemented for various reasons. + If you have any questions about this, feel free to reach out. + + - name: πŸ›‘ Out of Scope + labeled: + issue: + action: close + body: > + πŸ›‘ This issue has been marked as 'out of scope', as this can't or won't be implemented. + If you have any questions about this, feel free to reach out. - name: βœ… Done (staging) labeled: issue: body: > - It looks like all or part of this issue has now been implemented as part of the `staging` branch. + βœ… It looks like all or part of this issue has now been implemented as part of the `staging` branch. If you currently are on the `release` branch, you can switch to `staging` to test this right away. Note that `staging` is considered less stable than the official releases. To switch, follow existing instructions, @@ -43,15 +49,14 @@ labels: labeled: issue: body: > - It looks like all or part of this issue has now been implemented as part of the `latest` release. + βœ… It looks like all or part of this issue has now been implemented as part of the latest release. - name: ‼️ High Priority labeled: issue: body: > - This issue has been marked as high priority, indicating that it is important to the maintainers and the community. - While we cannot guarantee an immediate fix or provide an exact timeline, please rest assured that it is on our radar and will be addressed whenever possible. - Thank you for your patience and understanding. + 🚨 This issue has been marked high priority, meaning it's important to the maintainers or community. + While we can't promise immediate changes, it is on our radar and will be addressed whenever possible. Thanks for your patience! - name: πŸ’€ Spam labeled: @@ -60,5 +65,5 @@ labels: locking: lock lock_reason: spam body: > - This issue has been identified as spam, and is now locked. - Please refrain from posting spam in the future, as it disrupts the community and wastes valuable time. + πŸ’€ This issue has been flagged as spam and is now locked. + Please avoid posting spam - it disrupts the community and wastes everyone's time. diff --git a/.github/pr-auto-comments.yml b/.github/pr-auto-comments.yml index be935b098..24dca6153 100644 --- a/.github/pr-auto-comments.yml +++ b/.github/pr-auto-comments.yml @@ -1,39 +1,43 @@ -comment: - footer: > - --- - > I am a bot, and this is an automated message πŸ€– labels: - name: βœ–οΈ Invalid labeled: pr: action: close body: > - Thank you @{{ pull_request.user.login }} for contributing to this repository. - Your Pull Request has been marked as invalid. + Hey @{{ pull_request.user.login }}, thanks for your contribution! + Unfortunately, this PR has been marked as invalid. - Please ensure you follow the pull request template, provide all relevant info, - and target the correct branch. `staging` is the default target branch, `release` should only be targeted for important hotfixes. + Please check that you've followed the PR template, included all relevant details, and are targeting the correct branch (`staging` for regular contributions, `release` only for hotfixes). - If you have any questions, feel free to reach out. + If you need help, feel free to ask! - name: β›” Don't Merge labeled: pr: body: > - This PR has been temporarily blocked from merging. + 🚨 This PR has been temporarily blocked from merging. - name: πŸ’₯πŸ’£ Breaking Changes labeled: pr: body: > - This PR is marked as containing one or more breaking changes. + ⚠️ Heads up! This PR introduces breaking changes. - Please make sure that those are documented accordingly and steps to inform users at release are prepared. + Make sure these changes are well-documented and that users will be properly informed when this is released. - name: β›” Waiting For External/Upstream labeled: pr: body: > - This PR is awaiting external or upstream changes or approval. + β›” This PR is awaiting external or upstream changes or approval. It can only be merged once those changes have been implemented and approved. + Please inform us of any progress on the upstream changes or approval. + + - name: πŸ”¬ Needs Testing + labeled: + pr: + body: > + πŸ”¬ This PR needs testing! + Any contributor can test and leave reviews, so feel free to help us out! + diff --git a/.github/workflows/job-close-stale.yml b/.github/workflows/job-close-stale.yml index e44bf87b0..649b95530 100644 --- a/.github/workflows/job-close-stale.yml +++ b/.github/workflows/job-close-stale.yml @@ -26,15 +26,15 @@ jobs: remove-stale-when-updated: true enable-statistics: true stale-issue-message: > - This issue has gone 6 months without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. - Otherwise it will be closed in 7 days. + ⏳ This issue has been inactive for 6 months. If it's still relevant, drop a comment below to keep it open. + Otherwise, it will be auto-closed in 7 days. stale-pr-message: > - This PR is stale because it has been open 6 months with no activity. Either remove the stale label or comment below with a short update, - otherwise this PR will be closed in 7 days. + ⏳ This PR has been inactive for 6 months. If it's still relevant, update it or remove the stale label. + Otherwise, it will be auto-closed in 7 days. close-issue-message: > - This issue was automatically closed because it has been stalled for over 6 months with no activity. + πŸ”’ This issue was auto-closed due to inactivity for over 6 months. close-pr-message: > - This pull request was automatically closed because it has been stalled for over 6 months with no activity. + πŸ”’ This PR was auto-closed due to inactivity for over 6 months. stale-issue-label: '⚰️ Stale' close-issue-label: 'πŸ•ΈοΈ Inactive' stale-pr-label: '⚰️ Stale' @@ -60,10 +60,10 @@ jobs: operations-per-run: 30 remove-stale-when-updated: true stale-issue-message: > - Hi! Looks like additional info is required for this issue to be addressed. - Don't forget to provide this within the next few days to keep your ticket open. + ⚠️ Hey! We need some more info to move forward with this issue. + Please provide the requested details in the next few days to keep this ticket open. close-issue-message: > - Issue closed due to no response from user. + πŸ”’ This issue was auto-closed due to no response from user. only-labels: '🚏 Awaiting User Response' labels-to-remove-when-unstale: '🚏 Awaiting User Response' stale-issue-label: 'πŸ›‘ No Response' @@ -87,10 +87,11 @@ jobs: operations-per-run: 30 remove-stale-when-updated: true stale-issue-message: > - This issue was marked as having an alternative solution available. Did this help you out, and this issue can be closed? - Please confirm by commenting to keep it open, otherwise it will be closed in 7 days. + πŸ”„ An alternative solution has been provided for this issue. + Did this solve your problem? If so, we'll go ahead and close it. + If you still need help, drop a comment within the next 7 days to keep this open. close-issue-message: > - Issue closed automatically due to no confirmation regarding the alternative solution. + βœ… Closing this issue due to no confirmation on the alternative solution. only-labels: '🚧 Alternative Exists' stale-issue-label: '🚏 Awaiting User Response' close-issue-label: 'πŸ•ΈοΈ Inactive' diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml index 1b733521f..030548c4c 100644 --- a/.github/workflows/pr-auto-manager.yml +++ b/.github/workflows/pr-auto-manager.yml @@ -17,7 +17,8 @@ jobs: with: dirtyLabel: '🚫 Merge Conflicts' repoToken: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - commentOnDirty: "This pull request has conflicts. Please resolve them, otherwise it cannot be merged." + commentOnDirty: > + ⚠️ This PR has conflicts that need to be resolved before it can be merged. pr-size-labeler: name: Apply Label for PR Size @@ -41,9 +42,9 @@ jobs: xl_label: 'PR - XL' fail_if_xl: 'false' message_if_xl: > - This PR exceeds the recommended size of 1000 lines. - Please ensure you are not addressing multiple issues in one PR. - Note this PR might be rejected due to its size. + ⚠️ This PR is over 1000 lines, which is larger than recommended. + + Please make sure that it only addresses a single issue - PRs this large are hard to test and may be rejected. github_api_url: 'https://api.github.com' files_to_ignore: | "package-lock.json" @@ -168,5 +169,4 @@ jobs: for ISSUE in $(echo $final_issues | jq -r '.[]'); do echo "Updating issue #$ISSUE" gh issue edit $ISSUE -R ${{ github.repository }} --add-label "βœ… Done (staging)" - gh issue comment $ISSUE -R ${{ github.repository }} -b "This issue is now available in the \`staging\` branch for testing. Please verify and let us know any feedback!" done From 84e7ddbf743ca9f59d8fca1b0dbeae5c2ae3af1d Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 16:33:47 +0100 Subject: [PATCH 19/26] PR workflow, add labels based on files/branch name - Add PR labels based on changed files - Add PR labels based on branch names --- .github/pr-auto-labels,yml | 29 ---------- .github/pr-auto-labels-by-branch.yml | 77 +++++++++++++++++++++++++++ .github/pr-auto-labels-by-files.yml | 40 ++++++++++++++ .github/workflows/pr-auto-manager.yml | 34 +++++++----- 4 files changed, 137 insertions(+), 43 deletions(-) delete mode 100644 .github/pr-auto-labels,yml create mode 100644 .github/pr-auto-labels-by-branch.yml create mode 100644 .github/pr-auto-labels-by-files.yml diff --git a/.github/pr-auto-labels,yml b/.github/pr-auto-labels,yml deleted file mode 100644 index 1e94c18da..000000000 --- a/.github/pr-auto-labels,yml +++ /dev/null @@ -1,29 +0,0 @@ -🏭 Backend Changes: - - "src/**" - - "server.js" - - "plugins.js" - - "recover.js" - - "webpack.config.js" - - "Start.bat" - - "start.sh" - - "UpdateAndStart.bat" - - "UpdateForkAndStart.bat" - -πŸ› οΈ Build Changes: - - ".github/workflows/**" - - "docker/**" - - ".dockerignore" - - "Dockerfile" - - "webpack.config.js" - -🌐 Language: - - "public/locales/**" - -πŸ“₯ Dependencies: - - "public/lib/**" # Every frontend lib counts as a dependency as well - - "package.json" - - "package-lock.json" - - "tests/package.json" - - "tests/package-lock.json" - - "src/electron/package.json" - - "src/electron/package-lock.json" diff --git a/.github/pr-auto-labels-by-branch.yml b/.github/pr-auto-labels-by-branch.yml new file mode 100644 index 000000000..bbb91d760 --- /dev/null +++ b/.github/pr-auto-labels-by-branch.yml @@ -0,0 +1,77 @@ +#################################### +# Label PRs against 'release' # +#################################### +❗ Against Release Branch: +- base-branch: 'release' + +#################################### +# Labels based on PR branch name # +#################################### +πŸ¦‹ Bug Fix: +- head-branch: ['^fix[/-]', '\bfixes\b'] + +πŸš‘ Hot Fix: +- head-branch: ['^hotfix[/-]'] + +✨ New Feature: +- head-branch: ['^feat(ure)?[/-].*?\badd', '^add-'] + +✨ Feature Changes: +- head-branch: ['^feat(ure)?[/-](?!.*\badd\b)', '\bchanges?\b'] + +πŸ€– API / Model: +- head-branch: ['\bapi\b', '\bmodels?\b'] + +🏭 Backend Changes: +- head-branch: ['\bbackend\b', '\bendpoints?\b'] + +πŸ‹ Docker: +- head-branch: ['\bdocker\b'] + +βž• Extension: +- head-branch: ['\bextension\b', '\bext\b'] + +🦊 Firefox: +- head-branch: ['\bfirefox\b'] + +πŸ–ΌοΈ Image Gen: +- head-branch: ['\bimage-gen\b'] + +🌐 Language: +- head-branch: ['\btranslations?\b', '\blanguages?\b'] + +🐧 Linux: +- head-branch: ['\blinux\b'] + +🧩 Macros: +- head-branch: ['\bmacros?\b'] + +πŸ“± Mobile: +- head-branch: ['\bmobile\b', '\bios\b', '\bandroid\b'] + +πŸš„ Performance: +- head-branch: ['\bperformance\b'] + +βš™οΈ Preset: +- head-branch: ['\bpresets?\b'] + +πŸ“œ Prompt: +- head-branch: ['\bprompt\b'] + +🚚 Refactor: +- head-branch: ['\brefactor(s|ed)?\b'] + +πŸ“œ STscript: +- head-branch: ['\bstscript\b', '\bslash-commands\b'] + +🏷️ Tags / Folders: +- head-branch: ['\btags\b'] + +πŸŽ™οΈ TTS / Voice: +- head-branch: ['\btts\b', '\bvoice\b'] + +🌟 UX: +- head-branch: ['\bux\b'] + +πŸ—ΊοΈ World Info: +- head-branch: ['\bworld-info\b', '\bwi\b'] diff --git a/.github/pr-auto-labels-by-files.yml b/.github/pr-auto-labels-by-files.yml new file mode 100644 index 000000000..d20a0a995 --- /dev/null +++ b/.github/pr-auto-labels-by-files.yml @@ -0,0 +1,40 @@ +#################################### +# Labels based on changed files # +#################################### +🏭 Backend Changes: +- changed-files: + - any-glob-to-any-file: + - "src/**" + - "server.js" + - "plugins.js" + - "recover.js" + - "webpack.config.js" + - "Start.bat" + - "start.sh" + - "UpdateAndStart.bat" + - "UpdateForkAndStart.bat" + +πŸ› οΈ Build Changes: +- changed-files: + - any-glob-to-any-file: + - ".github/workflows/**" + - "docker/**" + - ".dockerignore" + - "Dockerfile" + - "webpack.config.js" + +🌐 Language: +- changed-files: + - any-glob-to-any-file: + - "public/locales/**" + +πŸ“₯ Dependencies: +- changed-files: + - any-glob-to-any-file: + - "public/lib/**" # Every frontend lib counts as a dependency as well + - "package.json" + - "package-lock.json" + - "tests/package.json" + - "tests/package-lock.json" + - "src/electron/package.json" + - "src/electron/package-lock.json" diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml index 030548c4c..1da762e50 100644 --- a/.github/workflows/pr-auto-manager.yml +++ b/.github/workflows/pr-auto-manager.yml @@ -20,7 +20,7 @@ jobs: commentOnDirty: > ⚠️ This PR has conflicts that need to be resolved before it can be merged. - pr-size-labeler: + label-by-size: name: Apply Label for PR Size runs-on: ubuntu-latest @@ -50,19 +50,22 @@ jobs: "package-lock.json" "public/lib/*" - label-release-prs: - name: Label PRs Targeting Release Branch + label-by-branches: + name: Apply Labels Based on Branch Name and Target Branch runs-on: ubuntu-latest + # Only label once when PR is created or branches are changed, to allow manual label removal + if: github.event.action == 'opened' || (github.event.action == 'synchronize' && (github.event.changes.base || github.event.changes.head)) steps: - - name: Label PRs Targeting Release Branch - if: github.base_ref == 'release' - run: | - gh pr edit ${{ github.event.pull_request.number }} --add-label "❗ Against Release Branch" - env: - GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + - name: Apply Labels Based on Branch Name and Target Branch + # Pull Request Labeler + # https://github.com/marketplace/actions/labeler + uses: actions/labeler@v5 + with: + configuration-path: .github/pr-auto-labels-by-branch.yml + repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - apply-file-based-labels: + label-by-files: name: Apply Labels Based on Changed Files runs-on: ubuntu-latest @@ -72,11 +75,12 @@ jobs: # https://github.com/marketplace/actions/labeler uses: actions/labeler@v5 with: + configuration-path: .github/pr-auto-labels-by-files.yml repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} check-merge-blocking-labels: name: Check Merge Blocking Labels - needs: [check-merge-conflicts, pr-size-labeler, label-release-prs, apply-file-based-labels] + needs: [check-merge-conflicts, label-by-size, label-by-branches, label-by-files] runs-on: ubuntu-latest steps: @@ -89,6 +93,7 @@ jobs: script: | const prLabels = context.payload.pull_request.labels.map(label => label.name); const blockingLabels = [ + "🚫 Merge Conflicts", "β›” Don't Merge", "πŸ”¨ Needs Work", "πŸ”¬ Needs Testing", @@ -116,9 +121,9 @@ jobs: console.log("No merge-blocking labels found."); } - pr-auto-comments: + write-auto-comments: name: Post PR Comments Based on Labels - needs: [check-merge-conflicts, pr-size-labeler, label-release-prs, apply-file-based-labels] + needs: [check-merge-conflicts, label-by-size, label-by-branches, label-by-files] runs-on: ubuntu-latest steps: @@ -162,7 +167,8 @@ jobs: ISSUES=$(jq -c -n --argjson a "$issues" --argjson b "$linked_issues" '$a + $b | unique') echo "final_issues=$ISSUES" >> $GITHUB_ENV - - name: Comment and Label Issues + - name: Label Linked Issues + id: label_linked_issues env: GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} run: | From ecaee2dbbf145e2da92667970177df2e1ef0a8ce Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 16:35:15 +0100 Subject: [PATCH 20/26] Directly remove stale labels on comments --- .github/workflows/job-close-stale.yml | 31 ++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/job-close-stale.yml b/.github/workflows/job-close-stale.yml index 649b95530..2ee79949b 100644 --- a/.github/workflows/job-close-stale.yml +++ b/.github/workflows/job-close-stale.yml @@ -1,17 +1,24 @@ name: 🎯 Close Stale Issues/PRs Workflow on: + # Run the workflow every day 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 @@ -41,12 +48,13 @@ jobs: close-pr-label: 'πŸ•ΈοΈ Inactive' exempt-issue-labels: 'πŸ“Œ Keep Open' exempt-pr-labels: 'πŸ“Œ Keep Open' - labels-to-add-when-unstale: 'πŸ“Œ Keep Open' await-user-response: 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 @@ -74,6 +82,8 @@ 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 @@ -96,4 +106,19 @@ jobs: stale-issue-label: '🚏 Awaiting User Response' close-issue-label: 'πŸ•ΈοΈ Inactive' exempt-issue-labels: 'πŸ“Œ Keep Open' - labels-to-add-when-unstale: 'πŸ“Œ 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 }} + labels: '⚰️ Stale,πŸ•ΈοΈ Inactive,🚏 Awaiting User Response,πŸ›‘ No Response' From eb17e37002a6235af39934e4cbe77a65df2683ae Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 16:42:49 +0100 Subject: [PATCH 21/26] Fix maintainer label, minor docs --- .github/workflows/issues-auto-manager.yml | 18 +++++++++++++----- .github/workflows/on-open-handler.yml | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/issues-auto-manager.yml b/.github/workflows/issues-auto-manager.yml index 8d577ac3f..1c62bb66f 100644 --- a/.github/workflows/issues-auto-manager.yml +++ b/.github/workflows/issues-auto-manager.yml @@ -5,7 +5,7 @@ on: types: [opened, edited, labeled, unlabeled] jobs: - issue-label-on-content: + label-on-content: name: Auto-Label Issues (Based on Issue Content) runs-on: ubuntu-latest @@ -22,21 +22,25 @@ jobs: enable-versioned-regex: 0 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - issue-label-on-labels: + label-on-labels: name: Auto-Label Issues (Based on Issue Labels) runs-on: ubuntu-latest steps: - name: βœ… Add "πŸ‘ Approved" for relevant labels if: contains(fromJSON('["πŸ‘©β€πŸ’» Good First Issue", "πŸ™ Help Wanted", "πŸͺ² Confirmed", "⚠️ High Priority", "❕ Medium Priority", "πŸ’€ Low Priority"]'), github.event.label.name) + # πŸ€– Issues Helper + # https://github.com/marketplace/actions/issues-helper uses: actions-cool/issues-helper@v3 with: actions: 'add-labels' token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} labels: 'πŸ‘ Approved' - - name: ❌ Remove progress labels when PR/issue is marked done or stale + - name: ❌ Remove progress labels when issue is marked done or stale if: contains(fromJSON('["βœ… Done", "βœ… Done (staging)", "⚰️ Stale", "❌ wontfix"]'), github.event.label.name) + # πŸ€– Issues Helper + # https://github.com/marketplace/actions/issues-helper uses: actions-cool/issues-helper@v3 with: actions: 'remove-labels' @@ -45,6 +49,8 @@ jobs: - name: ❌ Remove temporary labels when confirmed labels are added if: contains(fromJSON('["❌ wontfix","πŸ‘ Approved","πŸ‘©β€πŸ’» Good First Issue"]'), github.event.label.name) + # πŸ€– Issues Helper + # https://github.com/marketplace/actions/issues-helper uses: actions-cool/issues-helper@v3 with: actions: 'remove-labels' @@ -53,15 +59,17 @@ jobs: - name: ❌ Remove no bug labels when "πŸͺ² Confirmed" is added if: github.event.label.name == 'πŸͺ² Confirmed' + # πŸ€– 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 }} labels: 'βœ–οΈ Not Reproducible,βœ–οΈ Not A Bug' - issue-auto-comments: + write-auto-comments: name: Post Issue Comments Based on Labels - needs: [issue-label-on-content, issue-label-on-labels] + needs: [label-on-content, label-on-labels] runs-on: ubuntu-latest steps: diff --git a/.github/workflows/on-open-handler.yml b/.github/workflows/on-open-handler.yml index e4bab4a04..07e781475 100644 --- a/.github/workflows/on-open-handler.yml +++ b/.github/workflows/on-open-handler.yml @@ -43,7 +43,7 @@ jobs: owner, repo, issue_number, - labels: ['Maintainer'], + labels: ['πŸ‘· Maintainer'], }); } else { console.log(`User ${username} is not a repo maintainer.`); From 972eea1efd4083d88ac497aca2eaea37180fa1ba Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 19:28:23 +0100 Subject: [PATCH 22/26] Rename some labels, add config label - Rename PR size labels - Add config.yaml label on config changes - Add config.yaml to the backened changes label - Awaiting User Response will not be blocked by Keep Open --- .github/pr-auto-labels-by-files.yml | 6 ++++++ .github/workflows/job-close-stale.yml | 2 +- .github/workflows/pr-auto-manager.yml | 12 ++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/pr-auto-labels-by-files.yml b/.github/pr-auto-labels-by-files.yml index d20a0a995..55946ad2b 100644 --- a/.github/pr-auto-labels-by-files.yml +++ b/.github/pr-auto-labels-by-files.yml @@ -5,6 +5,7 @@ - changed-files: - any-glob-to-any-file: - "src/**" + - "default/config.yaml" - "server.js" - "plugins.js" - "recover.js" @@ -14,6 +15,11 @@ - "UpdateAndStart.bat" - "UpdateForkAndStart.bat" +βš™οΈ config.yaml: +- changed-files: + - any-glob-to-any-file: + - "default/config.yaml" + πŸ› οΈ Build Changes: - changed-files: - any-glob-to-any-file: diff --git a/.github/workflows/job-close-stale.yml b/.github/workflows/job-close-stale.yml index 2ee79949b..51cd7d339 100644 --- a/.github/workflows/job-close-stale.yml +++ b/.github/workflows/job-close-stale.yml @@ -76,7 +76,7 @@ jobs: labels-to-remove-when-unstale: '🚏 Awaiting User Response' stale-issue-label: 'πŸ›‘ No Response' close-issue-label: 'πŸ•ΈοΈ Inactive' - exempt-issue-labels: 'πŸ“Œ Keep Open,🚧 Alternative Exists' + exempt-issue-labels: '🚧 Alternative Exists' alternative-exists: name: Mark Issues with Alternative Exists diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml index 1da762e50..dc8c5441b 100644 --- a/.github/workflows/pr-auto-manager.yml +++ b/.github/workflows/pr-auto-manager.yml @@ -31,15 +31,15 @@ jobs: uses: codelytv/pr-size-labeler@v1 with: GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - xs_label: 'PR - Small' - xs_max_size: '1' - s_label: 'PR - Small' + xs_label: '🟩 ⬀○○○○' + xs_max_size: '20' + s_label: '🟩 ⬀⬀○○○' s_max_size: '100' - m_label: 'PR - Medium' + m_label: '🟨 ⬀⬀⬀○○' m_max_size: '500' - l_label: 'PR - Large' + l_label: '🟧 ⬀⬀⬀⬀○' l_max_size: '1000' - xl_label: 'PR - XL' + xl_label: 'πŸŸ₯ ⬀⬀⬀⬀⬀' fail_if_xl: 'false' message_if_xl: > ⚠️ This PR is over 1000 lines, which is larger than recommended. From 707efac5b9f3ef385b892855453a40e733e553be Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 19:40:41 +0100 Subject: [PATCH 23/26] Fix PR labeling failing --- .github/workflows/job-close-stale.yml | 1 + .github/workflows/on-close-handler.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job-close-stale.yml b/.github/workflows/job-close-stale.yml index 51cd7d339..ea67d8e96 100644 --- a/.github/workflows/job-close-stale.yml +++ b/.github/workflows/job-close-stale.yml @@ -121,4 +121,5 @@ jobs: 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/on-close-handler.yml b/.github/workflows/on-close-handler.yml index cc0cd3292..39da98688 100644 --- a/.github/workflows/on-close-handler.yml +++ b/.github/workflows/on-close-handler.yml @@ -19,5 +19,5 @@ jobs: with: actions: remove-labels token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} + issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} labels: '🚏 Awaiting User Response,πŸ§‘β€πŸ’» In Progress,πŸ“Œ Keep Open,🚫 Merge Conflicts,πŸ”¬ Needs Testing,πŸ”¨ Needs Work,⚰️ Stale,β›” Waiting For External/Upstream' From 15dbadbfe0d86dafc29a5958928cc3f41538ba1f Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 19:57:30 +0100 Subject: [PATCH 24/26] 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: From d9c868b2fed57e8f32a6c8596368801a54f2cf9c Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 20:12:55 +0100 Subject: [PATCH 25/26] Move PR size message to auto label replies --- .github/pr-auto-comments.yml | 8 ++++++++ .github/workflows/pr-auto-manager.yml | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/pr-auto-comments.yml b/.github/pr-auto-comments.yml index 24dca6153..bdb3e8022 100644 --- a/.github/pr-auto-comments.yml +++ b/.github/pr-auto-comments.yml @@ -41,3 +41,11 @@ labels: πŸ”¬ This PR needs testing! Any contributor can test and leave reviews, so feel free to help us out! + - name: πŸŸ₯ ⬀⬀⬀⬀⬀ + labeled: + pr: + body: > + ⚠️ This PR is over 1000 lines, which is larger than recommended. + + Please make sure that it only addresses a single issue - PRs this large are hard to test and may be rejected. + diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml index fb5a654ee..2120f2de5 100644 --- a/.github/workflows/pr-auto-manager.yml +++ b/.github/workflows/pr-auto-manager.yml @@ -43,10 +43,6 @@ jobs: l_max_size: '1000' xl_label: 'πŸŸ₯ ⬀⬀⬀⬀⬀' fail_if_xl: 'false' - message_if_xl: > - ⚠️ This PR is over 1000 lines, which is larger than recommended. - - Please make sure that it only addresses a single issue - PRs this large are hard to test and may be rejected. github_api_url: 'https://api.github.com' files_to_ignore: | "package-lock.json" From 5743972a26bf12bb6f9c6df3f1e8f28bd0522c94 Mon Sep 17 00:00:00 2001 From: Wolfsblvt <wolfsblvt@gmail.com> Date: Thu, 13 Mar 2025 22:13:00 +0100 Subject: [PATCH 26/26] Extract workflows for merge conflicts + issue done - Extract merge conflicts check to its own workflow, plus make it run on push - Add issues update as Done or Done staging based on extracted commit messages --- .github/workflows/issues-updates-on-merge.yml | 39 +++++++++++++++++++ .github/workflows/pr-auto-manager.yml | 27 ++++--------- .../workflows/pr-check-merge-conflicts.yaml | 24 ++++++++++++ 3 files changed, 71 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/issues-updates-on-merge.yml create mode 100644 .github/workflows/pr-check-merge-conflicts.yaml diff --git a/.github/workflows/issues-updates-on-merge.yml b/.github/workflows/issues-updates-on-merge.yml new file mode 100644 index 000000000..a0f091c34 --- /dev/null +++ b/.github/workflows/issues-updates-on-merge.yml @@ -0,0 +1,39 @@ +name: 🎯 Update Issues on Push + +on: + push: + branches: + - staging + - release + +jobs: + # This runs commits to staging/release, reading the commit messages. Check `pr-auto-manager.yml`:`update-linked-issues` for PR-linked updates. + update-linked-issues: + name: Update Issues on Push + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + # Checkout + # https://github.com/marketplace/actions/checkout + uses: actions/checkout@v4 + + - name: Extract Linked Issues from Commit Message + id: extract_issues + run: | + ISSUES=$(git log -1 --pretty=%B | grep -oiE '(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved) #([0-9]+)' | awk '{print $2}' | tr -d '#' | jq -R -s -c 'split("\n")[:-1]') + echo "issues=$ISSUES" >> $GITHUB_ENV + + - name: Label Linked Issues + id: label_linked_issues + env: + GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + run: | + for ISSUE in $(echo $issues | jq -r '.[]'); do + echo "Updating issue #$ISSUE" + if [ "${{ github.ref }}" == "refs/heads/staging" ]; then + gh issue edit $ISSUE -R ${{ github.repository }} --add-label "βœ… Done (staging)" + elif [ "${{ github.ref }}" == "refs/heads/release" ]; then + gh issue edit $ISSUE -R ${{ github.repository }} --add-label "βœ… Done" + fi + done diff --git a/.github/workflows/pr-auto-manager.yml b/.github/workflows/pr-auto-manager.yml index 2120f2de5..35cfabd8c 100644 --- a/.github/workflows/pr-auto-manager.yml +++ b/.github/workflows/pr-auto-manager.yml @@ -7,21 +7,6 @@ on: types: [created] jobs: - check-merge-conflicts: - name: Check Merge Conflicts - runs-on: ubuntu-latest - - steps: - - name: Check Merge Conflicts - # Label Conflicting Pull Requests - # https://github.com/marketplace/actions/label-conflicting-pull-requests - uses: eps1lon/actions-label-merge-conflict@v3 - with: - dirtyLabel: '🚫 Merge Conflicts' - repoToken: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - commentOnDirty: > - ⚠️ This PR has conflicts that need to be resolved before it can be merged. - label-by-size: name: Apply Label for PR Size runs-on: ubuntu-latest @@ -95,8 +80,10 @@ jobs: check-merge-blocking-labels: name: Check Merge Blocking Labels - needs: [check-merge-conflicts, label-by-branches] + needs: [label-by-branches, label-by-files] runs-on: ubuntu-latest + # Run, even if the previous jobs were skipped/failed + if: always() steps: - name: Check Merge Blocking @@ -108,7 +95,6 @@ jobs: script: | const prLabels = context.payload.pull_request.labels.map(label => label.name); const blockingLabels = [ - "🚫 Merge Conflicts", "β›” Don't Merge", "πŸ”¨ Needs Work", "πŸ”¬ Needs Testing", @@ -138,8 +124,10 @@ jobs: write-auto-comments: name: Post PR Comments Based on Labels - needs: [check-merge-conflicts, label-by-size, label-by-branches, label-by-files, remove-stale-label] + needs: [label-by-size, label-by-branches, label-by-files] runs-on: ubuntu-latest + # Run, even if the previous jobs were skipped/failed + if: always() steps: - name: Checkout Repository @@ -155,13 +143,14 @@ jobs: config_file: .github/pr-auto-comments.yml github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + # This runs on merged PRs to staging, reading the PR body and directly linked issues. Check `issues-updates-on-merge.yml`:`update-linked-issues` for commit-based updates. update-linked-issues: name: Update Issues on Staging Merge runs-on: ubuntu-latest if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'staging' steps: - - name: Extract Linked Issues + - name: Extract Linked Issues From PR Description id: extract_issues run: | ISSUES=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH" | grep -oiE '(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved) #([0-9]+)' | awk '{print $2}' | tr -d '#' | jq -R -s -c 'split("\n")[:-1]') diff --git a/.github/workflows/pr-check-merge-conflicts.yaml b/.github/workflows/pr-check-merge-conflicts.yaml new file mode 100644 index 000000000..553ef40c9 --- /dev/null +++ b/.github/workflows/pr-check-merge-conflicts.yaml @@ -0,0 +1,24 @@ +name: 🎯 Push Handler + +on: + # So that PRs touching the same files as the push are updated + push: + # So that the `dirtyLabel` is removed if conflicts are resolved + pull_request_target: + types: [synchronize] + +jobs: + check-merge-conflicts: + name: Check Merge Conflicts + runs-on: ubuntu-latest + + steps: + - name: Check Merge Conflicts + # Label Conflicting Pull Requests + # https://github.com/marketplace/actions/label-conflicting-pull-requests + uses: eps1lon/actions-label-merge-conflict@v3 + with: + dirtyLabel: '🚫 Merge Conflicts' + repoToken: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + commentOnDirty: > + ⚠️ This PR has conflicts that need to be resolved before it can be merged.