Merge pull request #3694 from SillyTavern/workflow-hotfixes Workflow hotfixes

ead37defeb84893e1e1bea1c98e6f9e0c0b53cdb

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
7 files changed, +65 -28Showing whitespace changes
.github/workflows/issues-auto-manager.yml+13 -9
@@ -7,6 +7,10 @@ on:
7 issue_comment:7 issue_comment:
8 types: [created]8 types: [created]
99
10permissions:
11 contents: read
12 issues: write
13
10jobs:14jobs:
11 label-on-content:15 label-on-content:
12 name: 🏷️ Label Issues by Content16 name: 🏷️ Label Issues by Content
@@ -16,7 +20,7 @@ jobs:
16 - name: Checkout Repository20 - name: Checkout Repository
17 # Checkout21 # Checkout
18 # https://github.com/marketplace/actions/checkout22 # https://github.com/marketplace/actions/checkout
19 uses: actions/checkout@v423 uses: actions/checkout@v4.2.2
2024
21 - name: Auto-Label Issues (Based on Issue Content)25 - name: Auto-Label Issues (Based on Issue Content)
22 # only auto label based on issue content once, on open (to prevent re-labeling removed labels)26 # only auto label based on issue content once, on open (to prevent re-labeling removed labels)
@@ -24,7 +28,7 @@ jobs:
2428
25 # Issue Labeler29 # Issue Labeler
26 # https://github.com/marketplace/actions/regex-issue-labeler30 # https://github.com/marketplace/actions/regex-issue-labeler
27 uses: github/issue-labeler@v331 uses: github/issue-labeler@v3.4
28 with:32 with:
29 configuration-path: .github/issues-auto-labels.yml33 configuration-path: .github/issues-auto-labels.yml
30 enable-versioned-regex: 034 enable-versioned-regex: 0
@@ -39,7 +43,7 @@ jobs:
39 if: contains(fromJSON('["πŸ‘©β€πŸ’» Good First Issue", "πŸ™ Help Wanted", "πŸͺ² Confirmed", "⚠️ High Priority", "❕ Medium Priority", "πŸ’€ Low Priority"]'), github.event.label.name)43 if: contains(fromJSON('["πŸ‘©β€πŸ’» Good First Issue", "πŸ™ Help Wanted", "πŸͺ² Confirmed", "⚠️ High Priority", "❕ Medium Priority", "πŸ’€ Low Priority"]'), github.event.label.name)
40 # πŸ€– Issues Helper44 # πŸ€– Issues Helper
41 # https://github.com/marketplace/actions/issues-helper45 # https://github.com/marketplace/actions/issues-helper
42 uses: actions-cool/issues-helper@v346 uses: actions-cool/issues-helper@v3.6.0
43 with:47 with:
44 actions: 'add-labels'48 actions: 'add-labels'
45 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}49 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -49,7 +53,7 @@ jobs:
49 if: contains(fromJSON('["βœ… Done", "βœ… Done (staging)", "⚰️ Stale", "❌ wontfix"]'), github.event.label.name)53 if: contains(fromJSON('["βœ… Done", "βœ… Done (staging)", "⚰️ Stale", "❌ wontfix"]'), github.event.label.name)
50 # πŸ€– Issues Helper54 # πŸ€– Issues Helper
51 # https://github.com/marketplace/actions/issues-helper55 # https://github.com/marketplace/actions/issues-helper
52 uses: actions-cool/issues-helper@v356 uses: actions-cool/issues-helper@v3.6.0
53 with:57 with:
54 actions: 'remove-labels'58 actions: 'remove-labels'
55 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}59 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -59,7 +63,7 @@ jobs:
59 if: contains(fromJSON('["❌ wontfix","πŸ‘ Approved","πŸ‘©β€πŸ’» Good First Issue"]'), github.event.label.name)63 if: contains(fromJSON('["❌ wontfix","πŸ‘ Approved","πŸ‘©β€πŸ’» Good First Issue"]'), github.event.label.name)
60 # πŸ€– Issues Helper64 # πŸ€– Issues Helper
61 # https://github.com/marketplace/actions/issues-helper65 # https://github.com/marketplace/actions/issues-helper
62 uses: actions-cool/issues-helper@v366 uses: actions-cool/issues-helper@v3.6.0
63 with:67 with:
64 actions: 'remove-labels'68 actions: 'remove-labels'
65 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}69 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -69,7 +73,7 @@ jobs:
69 if: github.event.label.name == 'πŸͺ² Confirmed'73 if: github.event.label.name == 'πŸͺ² Confirmed'
70 # πŸ€– Issues Helper74 # πŸ€– Issues Helper
71 # https://github.com/marketplace/actions/issues-helper75 # https://github.com/marketplace/actions/issues-helper
72 uses: actions-cool/issues-helper@v376 uses: actions-cool/issues-helper@v3.6.0
73 with:77 with:
74 actions: 'remove-labels'78 actions: 'remove-labels'
75 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}79 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -85,7 +89,7 @@ jobs:
85 - name: Remove Stale Label89 - name: Remove Stale Label
86 # πŸ€– Issues Helper90 # πŸ€– Issues Helper
87 # https://github.com/marketplace/actions/issues-helper91 # https://github.com/marketplace/actions/issues-helper
88 uses: actions-cool/issues-helper@v392 uses: actions-cool/issues-helper@v3.6.0
89 with:93 with:
90 actions: 'remove-labels'94 actions: 'remove-labels'
91 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}95 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -101,12 +105,12 @@ jobs:
101 - name: Checkout Repository105 - name: Checkout Repository
102 # Checkout106 # Checkout
103 # https://github.com/marketplace/actions/checkout107 # https://github.com/marketplace/actions/checkout
104 uses: actions/checkout@v4108 uses: actions/checkout@v4.2.2
105109
106 - name: Post Issue Comments Based on Labels110 - name: Post Issue Comments Based on Labels
107 # Label Commenter111 # Label Commenter
108 # https://github.com/marketplace/actions/label-commenter112 # https://github.com/marketplace/actions/label-commenter
109 uses: peaceiris/actions-label-commenter@v1113 uses: peaceiris/actions-label-commenter@v1.10.0
110 with:114 with:
111 config_file: .github/issues-auto-comments.yml115 config_file: .github/issues-auto-comments.yml
112 github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}116 github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
.github/workflows/issues-updates-on-merge.yml+6 -2
@@ -6,6 +6,10 @@ on:
6 - staging6 - staging
7 - release7 - release
88
9permissions:
10 contents: read
11 issues: write
12
9jobs:13jobs:
10 # This runs commits to staging/release, reading the commit messages. Check `pr-auto-manager.yml`:`update-linked-issues` for PR-linked updates.14 # This runs commits to staging/release, reading the commit messages. Check `pr-auto-manager.yml`:`update-linked-issues` for PR-linked updates.
11 update-linked-issues:15 update-linked-issues:
@@ -16,12 +20,12 @@ jobs:
16 - name: Checkout Repository20 - name: Checkout Repository
17 # Checkout21 # Checkout
18 # https://github.com/marketplace/actions/checkout22 # https://github.com/marketplace/actions/checkout
19 uses: actions/checkout@v423 uses: actions/checkout@v4.2.2
2024
21 - name: Extract Linked Issues from Commit Message25 - name: Extract Linked Issues from Commit Message
22 id: extract_issues26 id: extract_issues
23 run: |27 run: |
24 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]')28 ISSUES=$(git log ${{ github.event.before }}..${{ github.event.after }} --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]')
25 echo "issues=$ISSUES" >> $GITHUB_ENV29 echo "issues=$ISSUES" >> $GITHUB_ENV
2630
27 - name: Label Linked Issues31 - name: Label Linked Issues
.github/workflows/job-close-stale.yml+8 -3
@@ -6,6 +6,11 @@ on:
6 schedule:6 schedule:
7 - cron: '0 0 * * *' # Runs every day at midnight UTC7 - cron: '0 0 * * *' # Runs every day at midnight UTC
88
9permissions:
10 contents: read
11 issues: write
12 pull-requests: write
13
9jobs:14jobs:
10 mark-inactivity:15 mark-inactivity:
11 name: ⏳ Mark Issues/PRs without Activity16 name: ⏳ Mark Issues/PRs without Activity
@@ -15,7 +20,7 @@ jobs:
15 - name: Mark Issues/PRs without Activity20 - name: Mark Issues/PRs without Activity
16 # Close Stale Issues and PRs21 # Close Stale Issues and PRs
17 # https://github.com/marketplace/actions/close-stale-issues22 # https://github.com/marketplace/actions/close-stale-issues
18 uses: actions/stale@v923 uses: actions/stale@v9.1.0
19 with:24 with:
20 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}25 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
21 days-before-stale: 18326 days-before-stale: 183
@@ -49,7 +54,7 @@ jobs:
49 - name: Mark Issues/PRs Awaiting User Response54 - name: Mark Issues/PRs Awaiting User Response
50 # Close Stale Issues and PRs55 # Close Stale Issues and PRs
51 # https://github.com/marketplace/actions/close-stale-issues56 # https://github.com/marketplace/actions/close-stale-issues
52 uses: actions/stale@v957 uses: actions/stale@v9.1.0
53 with:58 with:
54 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}59 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
55 days-before-stale: 760 days-before-stale: 7
@@ -76,7 +81,7 @@ jobs:
76 - name: Mark Issues with Alternative Exists81 - name: Mark Issues with Alternative Exists
77 # Close Stale Issues and PRs82 # Close Stale Issues and PRs
78 # https://github.com/marketplace/actions/close-stale-issues83 # https://github.com/marketplace/actions/close-stale-issues
79 uses: actions/stale@v984 uses: actions/stale@v9.1.0
80 with:85 with:
81 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}86 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
82 days-before-stale: 787 days-before-stale: 7
.github/workflows/on-close-handler.yml+6 -1
@@ -6,6 +6,11 @@ on:
6 pull_request_target:6 pull_request_target:
7 types: [closed]7 types: [closed]
88
9permissions:
10 contents: read
11 issues: write
12 pull-requests: write
13
9jobs:14jobs:
10 remove-labels:15 remove-labels:
11 name: πŸ—‘οΈ Remove Pending Labels on Close16 name: πŸ—‘οΈ Remove Pending Labels on Close
@@ -15,7 +20,7 @@ jobs:
15 - name: Remove Pending Labels on Close20 - name: Remove Pending Labels on Close
16 # πŸ€– Issues Helper21 # πŸ€– Issues Helper
17 # https://github.com/marketplace/actions/issues-helper22 # https://github.com/marketplace/actions/issues-helper
18 uses: actions-cool/issues-helper@v323 uses: actions-cool/issues-helper@v3.6.0
19 with:24 with:
20 actions: remove-labels25 actions: remove-labels
21 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}26 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
.github/workflows/on-open-handler.yml+6 -1
@@ -6,6 +6,11 @@ on:
6 pull_request_target:6 pull_request_target:
7 types: [opened]7 types: [opened]
88
9permissions:
10 contents: read
11 issues: write
12 pull-requests: write
13
9jobs:14jobs:
10 label-maintainer:15 label-maintainer:
11 name: 🏷️ Label if Author is a Repo Maintainer16 name: 🏷️ Label if Author is a Repo Maintainer
@@ -16,7 +21,7 @@ jobs:
16 - name: Label if Author is a Repo Maintainer21 - name: Label if Author is a Repo Maintainer
17 # πŸ€– Issues Helper22 # πŸ€– Issues Helper
18 # https://github.com/marketplace/actions/issues-helper23 # https://github.com/marketplace/actions/issues-helper
19 uses: actions-cool/issues-helper@v324 uses: actions-cool/issues-helper@v3.6.0
20 with:25 with:
21 actions: 'add-labels'26 actions: 'add-labels'
22 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}27 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
.github/workflows/pr-auto-manager.yml+21 -11
@@ -6,6 +6,10 @@ on:
6 pull_request_review_comment:6 pull_request_review_comment:
7 types: [created]7 types: [created]
88
9permissions:
10 contents: read
11 pull-requests: write
12
9jobs:13jobs:
10 label-by-size:14 label-by-size:
11 name: 🏷️ Label PR by Size15 name: 🏷️ Label PR by Size
@@ -15,7 +19,7 @@ jobs:
15 - name: Label PR Size19 - name: Label PR Size
16 # Pull Request Size Labeler20 # Pull Request Size Labeler
17 # https://github.com/marketplace/actions/pull-request-size-labeler21 # https://github.com/marketplace/actions/pull-request-size-labeler
18 uses: codelytv/pr-size-labeler@v122 uses: codelytv/pr-size-labeler@v1.10.2
19 with:23 with:
20 GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}24 GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
21 xs_label: '🟩 ⬀○○○○'25 xs_label: '🟩 ⬀○○○○'
@@ -43,12 +47,12 @@ jobs:
43 - name: Checkout Repository47 - name: Checkout Repository
44 # Checkout48 # Checkout
45 # https://github.com/marketplace/actions/checkout49 # https://github.com/marketplace/actions/checkout
46 uses: actions/checkout@v450 uses: actions/checkout@v4.2.2
4751
48 - name: Apply Labels Based on Branch Name and Target Branch52 - name: Apply Labels Based on Branch Name and Target Branch
49 # Pull Request Labeler53 # Pull Request Labeler
50 # https://github.com/marketplace/actions/labeler54 # https://github.com/marketplace/actions/labeler
51 uses: actions/labeler@v555 uses: actions/labeler@v5.0.0
52 with:56 with:
53 configuration-path: .github/pr-auto-labels-by-branch.yml57 configuration-path: .github/pr-auto-labels-by-branch.yml
54 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}58 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -61,12 +65,12 @@ jobs:
61 - name: Checkout Repository65 - name: Checkout Repository
62 # Checkout66 # Checkout
63 # https://github.com/marketplace/actions/checkout67 # https://github.com/marketplace/actions/checkout
64 uses: actions/checkout@v468 uses: actions/checkout@v4.2.2
6569
66 - name: Apply Labels Based on Changed Files70 - name: Apply Labels Based on Changed Files
67 # Pull Request Labeler71 # Pull Request Labeler
68 # https://github.com/marketplace/actions/labeler72 # https://github.com/marketplace/actions/labeler
69 uses: actions/labeler@v573 uses: actions/labeler@v5.0.0
70 with:74 with:
71 configuration-path: .github/pr-auto-labels-by-files.yml75 configuration-path: .github/pr-auto-labels-by-files.yml
72 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}76 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -75,13 +79,13 @@ jobs:
75 name: πŸ—‘οΈ Remove Stale Label on Comment79 name: πŸ—‘οΈ Remove Stale Label on Comment
76 runs-on: ubuntu-latest80 runs-on: ubuntu-latest
77 # Only runs when this is not done by the github actions bot81 # Only runs when this is not done by the github actions bot
78 if: github.actor != 'github-actions[bot]'82 if: github.event_name == 'pull_request_review_comment' && github.actor != 'github-actions[bot]'
7983
80 steps:84 steps:
81 - name: Remove Stale Label85 - name: Remove Stale Label
82 # πŸ€– Issues Helper86 # πŸ€– Issues Helper
83 # https://github.com/marketplace/actions/issues-helper87 # https://github.com/marketplace/actions/issues-helper
84 uses: actions-cool/issues-helper@v388 uses: actions-cool/issues-helper@v3.6.0
85 with:89 with:
86 actions: 'remove-labels'90 actions: 'remove-labels'
87 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}91 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
@@ -95,12 +99,18 @@ jobs:
95 # Run, even if the previous jobs were skipped/failed99 # Run, even if the previous jobs were skipped/failed
96 if: always()100 if: always()
97101
102 # Override permissions, as this needs to write a check
103 permissions:
104 checks: write
105 contents: read
106 pull-requests: read
107
98 steps:108 steps:
99 - name: Check Merge Blocking109 - name: Check Merge Blocking
100 # GitHub Script110 # GitHub Script
101 # https://github.com/marketplace/actions/github-scriptLabels111 # https://github.com/marketplace/actions/github-script
102 id: label-check112 id: label-check
103 uses: actions/github-script@v7113 uses: actions/github-script@v7.0.1
104 with:114 with:
105 script: |115 script: |
106 const prLabels = context.payload.pull_request.labels.map(label => label.name);116 const prLabels = context.payload.pull_request.labels.map(label => label.name);
@@ -143,12 +153,12 @@ jobs:
143 - name: Checkout Repository153 - name: Checkout Repository
144 # Checkout154 # Checkout
145 # https://github.com/marketplace/actions/checkout155 # https://github.com/marketplace/actions/checkout
146 uses: actions/checkout@v4156 uses: actions/checkout@v4.2.2
147157
148 - name: Post PR Comments Based on Labels158 - name: Post PR Comments Based on Labels
149 # Label Commenter for PRs159 # Label Commenter for PRs
150 # https://github.com/marketplace/actions/label-commenter160 # https://github.com/marketplace/actions/label-commenter
151 uses: peaceiris/actions-label-commenter@v1161 uses: peaceiris/actions-label-commenter@v1.10.0
152 with:162 with:
153 config_file: .github/pr-auto-comments.yml163 config_file: .github/pr-auto-comments.yml
154 github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}164 github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
.github/workflows/pr-check-merge-conflicts.yaml+5 -1
@@ -7,6 +7,10 @@ on:
7 pull_request_target:7 pull_request_target:
8 types: [synchronize]8 types: [synchronize]
99
10permissions:
11 contents: read
12 pull-requests: write
13
10jobs:14jobs:
11 check-merge-conflicts:15 check-merge-conflicts:
12 name: βš”οΈ Check Merge Conflicts16 name: βš”οΈ Check Merge Conflicts
@@ -16,7 +20,7 @@ jobs:
16 - name: Check Merge Conflicts20 - name: Check Merge Conflicts
17 # Label Conflicting Pull Requests21 # Label Conflicting Pull Requests
18 # https://github.com/marketplace/actions/label-conflicting-pull-requests22 # https://github.com/marketplace/actions/label-conflicting-pull-requests
19 uses: eps1lon/actions-label-merge-conflict@v323 uses: eps1lon/actions-label-merge-conflict@v3.0.3
20 with:24 with:
21 dirtyLabel: '🚫 Merge Conflicts'25 dirtyLabel: '🚫 Merge Conflicts'
22 repoToken: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}26 repoToken: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}