Refactor workflows into more structured files

This commit is contained in:
Wolfsblvt
2025-03-11 21:43:27 +01:00
parent c722d251ff
commit d6dcededc9
13 changed files with 148 additions and 159 deletions

View File

@@ -1,2 +0,0 @@
🐛 Bug: ✅ Fixed
🦄 Feature Request: ✅ Implemented

View File

@@ -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.
Users who repeatedly

View File

@@ -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)'
- '(🐧 Linux)'

15
.github/pr-auto-comments.yml vendored Normal file
View File

@@ -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.

View File

@@ -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 }}

View File

@@ -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."

View File

@@ -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/*"

View File

@@ -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 }}

View File

@@ -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'

View File

@@ -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

View File

@@ -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 }}

69
.github/workflows/pr-auto-manager.yml vendored Normal file
View File

@@ -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 }}

View File

@@ -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'