Refactor workflows into more structured files

d6dcededc9a910fd0e8b2c01b15d5f7ce9077aeb

Wolfsblvt <wolfsblvt@gmail.com>

12 files changed, +142 -153Ignore whitespace
.github/close-label.yml+0 -2
@@ -1,2 +0,0 @@
1-πŸ› Bug: βœ… Fixed
2-πŸ¦„ Feature Request: βœ… Implemented
2 \ No newline at end of file
.github/issue-auto-comments.yml β†’ .github/issues-auto-comments.yml+1 -10
@@ -11,9 +11,6 @@ labels:
1111 Hello @{{ issue.user.login }} your ticket has been marked as invalid.
1212 Please ensure you follow the issue template, provide all requested info,
1313 and be sure to check the docs + previous issues prior to raising tickets.
14- pr:
15- body: Thank you @{{ pull_request.user.login }} for suggesting this. Please follow the pull request templates.
16- action: close
1714
1815 - name: πŸ‘©β€πŸ’» Good First Issue
1916 labeled:
@@ -38,7 +35,6 @@ labels:
3835 body: >
3936 Hello @{{ issue.user.login }}! It looks like all or part of this issue has now been implemented.
4037
41-
4238 - name: ‼️ High Priority
4339 labeled:
4440 issue:
@@ -54,9 +50,4 @@ labels:
5450 lock_reason: spam
5551 body: >
5652 This issue has been identified as spam, and is now locked.
57- Users who repeatedly raise spam issues may be blocked or reported.
58-
59- - name: β›” Don't Merge
60- labeled:
61- pr:
62- body: This PR has been temporarily blocked from merging.
62 \ No newline at end of file
53+ Users who repeatedly
.github/labeler.yml β†’ .github/issues-auto-labeler.yml+1 -5
@@ -1,7 +1,3 @@
1-# Add/remove 'critical' label if issue contains the words 'urgent' or 'critical'
2-#critical:
3-# - '(critical|urgent)'
4-
51πŸͺŸ Windows:
62 - '(πŸͺŸ Windows)'
73
@@ -15,4 +11,4 @@
1511 - '(πŸ“± Termux)'
1612
1713🐧 Linux:
18- - '(🐧 Linux)'
18 \ No newline at end of file
14+ - '(🐧 Linux)'
.github/pr-auto-comments.yml+15 -0
@@ -0,0 +1,15 @@
1+comment:
2+ footer: |
3+ ---
4+ > I am a bot, and this is an automated message πŸ€–
5+labels:
6+ - name: βœ–οΈ Invalid
7+ labeled:
8+ pr:
9+ body: Thank you @{{ pull_request.user.login }} for suggesting this. Please follow the pull request templates.
10+ action: close
11+
12+ - name: β›” Don't Merge
13+ labeled:
14+ pr:
15+ body: This PR has been temporarily blocked from merging.
.github/workflows/add-comment-from-tag.yml+0 -28
@@ -1,28 +0,0 @@
1-# Based on a label applied to an issue, the bot will add a comment with some additional info
2-
3-name: 🎯 Auto-Reply to Labeled Tickets
4-on:
5- issues:
6- types:
7- - labeled
8- - unlabeled
9- pull_request_target:
10- types:
11- - labeled
12- - unlabeled
13-permissions:
14- contents: read
15- issues: write
16- pull-requests: write
17-
18-jobs:
19- comment:
20- runs-on: ubuntu-20.04
21- steps:
22- - name: Checkout
23- uses: actions/checkout@v2
24- - name: Label Commenter
25- uses: peaceiris/actions-label-commenter@v1
26- with:
27- config_file: .github/issue-auto-comments.yml
28- github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
28 \ No newline at end of file
.github/workflows/check-merge-conflicts.yml+0 -25
@@ -1,25 +0,0 @@
1-# Detect and label pull requests that have merge conflicts
2-
3-# Label Conflicting Pull Requests
4-# https://github.com/marketplace/actions/label-conflicting-pull-requests
5-
6-name: πŸ—οΈ Check Merge Conflicts
7-on:
8- # So that PRs touching the same files as the push are updated
9- push:
10- # So that the `dirtyLabel` is removed if conflicts are resolve
11- # We recommend `pull_request_target` so that github secrets are available.
12- # In `pull_request` we wouldn't be able to change labels of fork PRs
13- pull_request_target:
14- types: [synchronize]
15-
16-jobs:
17- check-conflicts:
18- runs-on: ubuntu-latest
19- steps:
20- - name: Check Merge Conflicts
21- uses: eps1lon/actions-label-merge-conflict@v3
22- with:
23- dirtyLabel: "🚫 Merge Conflicts"
24- repoToken: "${{ secrets.GITHUB_TOKEN }}"
25- commentOnDirty: "This pull request has conflicts. Please resolve them, otherwise it cannot be merged."
.github/workflows/get-pr-size.yml+0 -39
@@ -1,39 +0,0 @@
1-# Adds labels to pull requests based on the size of the changes (changed lines)
2-
3-# 🏷 Pull Request Size Labeler
4-# https://github.com/marketplace/actions/pull-request-size-labeler
5-
6-name: 🌈 Label PR Size
7-
8-on: [pull_request]
9-
10-jobs:
11- labeler:
12- permissions:
13- pull-requests: write
14- contents: read
15- issues: write
16- runs-on: ubuntu-latest
17- name: Label the PR size
18- steps:
19- - uses: codelytv/pr-size-labeler@v1
20- with:
21- GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
22- xs_label: 'PR - Small'
23- xs_max_size: '1'
24- s_label: 'PR - Small'
25- s_max_size: '100'
26- m_label: 'PR - Medium'
27- m_max_size: '500'
28- l_label: 'PR - Large'
29- l_max_size: '1000'
30- xl_label: 'PR - XL'
31- fail_if_xl: 'false'
32- message_if_xl: >
33- This PR exceeds the recommended size of 1000 lines.
34- Please make sure you are not addressing multiple issues with one PR.
35- Note this PR might be rejected due to its size.
36- github_api_url: 'https://api.github.com'
37- files_to_ignore: |
38- "package-lock.json"
39- "public/lib/*"
.github/workflows/issues-auto-manager.yml+33 -0
@@ -0,0 +1,33 @@
1+name: 🎯 Issues Auto Manager
2+
3+on:
4+ issues:
5+ types: [opened, edited, labeled, unlabeled]
6+
7+jobs:
8+ manage-issues:
9+ name: Manage Issues
10+ runs-on: ubuntu-latest
11+
12+ steps:
13+ - name: Checkout Repository
14+ # Checkout
15+ # https://github.com/marketplace/actions/checkout
16+ uses: actions/checkout@v4
17+
18+ - name: Auto-Label Issues
19+ # Issue Labeler
20+ # https://github.com/marketplace/actions/regex-issue-labeler
21+ uses: github/issue-labeler@v3
22+ with:
23+ configuration-path: .github/issues-auto-labeler.yml
24+ enable-versioned-regex: 0
25+ repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
26+
27+ - name: Post Issue Comments Based on Labels
28+ # Label Commenter
29+ # https://github.com/marketplace/actions/label-commenter
30+ uses: peaceiris/actions-label-commenter@v1
31+ with:
32+ config_file: .github/issues-auto-comments.yml
33+ github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
.github/workflows/remove-pending-labels-on-close.yml β†’ .github/workflows/issues-close-handler.yml+14 -16
@@ -1,22 +1,20 @@
1-# 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
1+name: 🎯 Issues Close Handler
2-
3-# πŸ€– Issues Helper
4-# https://github.com/marketplace/actions/issues-helper
5-
6-name: 🎯 Remove Pending Labels on Close
72on:
83 issues:
94 types: [closed]
105 pull_requestpull_request_target:
116 types: [closed]
127jobs:
138 remove-labels:
14- runs-on: ubuntu-latest
9+ name: Remove Pending Labels on Close
15- steps:
10+ runs-on: ubuntu-latest
16- - name: Remove Labels when Closed
11+ steps:
17- uses: actions-cool/issues-helper@v3
12+ - name: Remove Pending Labels on Close
18- with:
13+ # πŸ€– Issues Helper
19- actions: remove-labels
14+ # https://github.com/marketplace/actions/issues-helper
20- token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
15+ uses: actions-cool/issues-helper@v3
21- issue-number: ${{ github.event.issue.number }}
16+ with:
22- labels: '🚏 Awaiting User Response,πŸ§‘β€πŸ’» In Progress,πŸ“Œ Keep Open,🚫 Merge Conflicts,πŸ”¬ Needs Testing,πŸ”¨ Needs Work,⚰️ Stale,β›” Waiting For External/Upstream'
17+ actions: remove-labels
18+ token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
19+ issue-number: ${{ github.event.issue.number }}
20+ labels: '🚏 Awaiting User Response,πŸ§‘β€πŸ’» In Progress,πŸ“Œ Keep Open,🚫 Merge Conflicts,πŸ”¬ Needs Testing,πŸ”¨ Needs Work,⚰️ Stale,β›” Waiting For External/Upstream'
.github/workflows/close-stale-issues.yml β†’ .github/workflows/issues-close-stale.yml+9 -9
@@ -1,8 +1,3 @@
1-# Auto-label and close any issues that no longer have user interaction
2-
3-# Close Stale Issues and PRs
4-# https://github.com/marketplace/actions/close-stale-issues
5-
61name: 🎯 Close Stale Issues
72
83on:
@@ -11,12 +6,15 @@ on:
116 - cron: '0 0 * * *' # Runs every day at midnight UTC
127
138jobs:
149 close-stale:
10+ name: Close Stale Issues
1511 runs-on: ubuntu-latest
1612
1713 steps:
1814 # Comment on, then close issues that haven't been updated for ages
1915 - name: Close StaleMark Issues without Activity
16+ # Close Stale Issues and PRs
17+ # https://github.com/marketplace/actions/close-stale-issues
2018 uses: actions/stale@v9
2119 with:
2220 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -44,8 +42,10 @@ jobs:
4442 labels-to-add-when-unstale: 'πŸ“Œ Keep Open'
4543
4644 # Comment on, then close issues that required a response from the user, but didn't get one
4745 - name: CloseMark Issues withoutwith Requested Response
48- uses: actions/stale@v4
46+ # Close Stale Issues and PRs
47+ # https://github.com/marketplace/actions/close-stale-issues
48+ uses: actions/stale@v9
4949 with:
5050 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
5151 days-before-stale: 7
.github/workflows/labeler.yml+0 -19
@@ -1,19 +0,0 @@
1-name: "Issue Labeler"
2-on:
3- issues:
4- types: [opened, edited]
5-
6-permissions:
7- issues: write
8- contents: read
9-
10-jobs:
11- triage:
12- runs-on: ubuntu-latest
13- steps:
14- - uses: github/issue-labeler@v3.4
15- with:
16- configuration-path: .github/labeler.yml
17-# not-before: 2020-01-15T02:54:32Z # optional and will result in any issues prior to this timestamp to be ignored.
18- enable-versioned-regex: 0
19- repo-token: ${{ github.token }}
19 \ No newline at end of file
.github/workflows/pr-auto-manager.yml+69 -0
@@ -0,0 +1,69 @@
1+name: 🎯 Pull Request Auto Manager
2+
3+on:
4+ pull_request_target:
5+ types: [opened, synchronize, reopened, edited, labeled, unlabeled]
6+
7+jobs:
8+ check-merge-conflicts:
9+ name: Check Merge Conflicts
10+ runs-on: ubuntu-latest
11+
12+ steps:
13+ - name: Check Merge Conflicts
14+ # Label Conflicting Pull Requests
15+ # https://github.com/marketplace/actions/label-conflicting-pull-requests
16+ uses: eps1lon/actions-label-merge-conflict@v3
17+ with:
18+ dirtyLabel: '🚫 Merge Conflicts'
19+ repoToken: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
20+ commentOnDirty: "This pull request has conflicts. Please resolve them, otherwise it cannot be merged."
21+
22+ pr-size-labeler:
23+ name: Label PR Size
24+ runs-on: ubuntu-latest
25+
26+ steps:
27+ - name: Label PR Size
28+ # Pull Request Size Labeler
29+ # https://github.com/marketplace/actions/pull-request-size-labeler
30+ uses: codelytv/pr-size-labeler@v1
31+ with:
32+ GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
33+ xs_label: 'PR - Small'
34+ xs_max_size: '1'
35+ s_label: 'PR - Small'
36+ s_max_size: '100'
37+ m_label: 'PR - Medium'
38+ m_max_size: '500'
39+ l_label: 'PR - Large'
40+ l_max_size: '1000'
41+ xl_label: 'PR - XL'
42+ fail_if_xl: 'false'
43+ message_if_xl: >
44+ This PR exceeds the recommended size of 1000 lines.
45+ Please ensure you are not addressing multiple issues in one PR.
46+ Note this PR might be rejected due to its size.
47+ github_api_url: 'https://api.github.com'
48+ files_to_ignore: |
49+ "package-lock.json"
50+ "public/lib/*"
51+
52+ pr-auto-comments:
53+ name: Post PR Comments Based on Labels
54+ needs: [check-merge-conflicts, pr-size-labeler]
55+ runs-on: ubuntu-latest
56+
57+ steps:
58+ - name: Checkout Repository
59+ # Checkout
60+ # https://github.com/marketplace/actions/checkout
61+ uses: actions/checkout@v4
62+
63+ - name: Post PR Comments Based on Labels
64+ # Label Commenter for PRs
65+ # https://github.com/marketplace/actions/label-commenter
66+ uses: peaceiris/actions-label-commenter@v1
67+ with:
68+ config_file: .github/pr-auto-comments.yml
69+ github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}