Merge pull request #3719 from SillyTavern/fix-workflows-v2-v1.1 Fixing GitHub Workflows - again (maybe this time it works)

909c7f1037ffb616f61f312bc37a6c12024f7d24

Wolfsblvt <wolfsblvt@gmail.com>

Signed
9 files changed, +49 -28Ignore whitespace
.github/issues-auto-labels.yml+2 -2
@@ -14,7 +14,7 @@
1414 - '(🐧 Linux)'
1515
1616🦊 Firefox:
1717 - '\b(firefox|mozilla)\b'
1818
1919πŸ“± Mobile:
2020 - '\b(iphone|ios|android|πŸ“± Termux)\b'
.github/pr-auto-labels-by-branch.yml+6 -0
@@ -34,6 +34,9 @@
3434🦊 Firefox:
3535- head-branch: ['\bfirefox\b']
3636
37+πŸ§‘β€πŸ€β€πŸ§‘ Group Chat:
38+- head-branch: ['\bgroups?\b']
39+
3740πŸ–ΌοΈ Image Gen:
3841- head-branch: ['\bimage-gen\b']
3942
@@ -58,6 +61,9 @@
5861πŸ“œ Prompt:
5962- head-branch: ['\bprompt\b']
6063
64+🧠 Reasoning:
65+- head-branch: ['\breasoning\b', '\breason\b', '\bthinking\b']
66+
6167🚚 Refactor:
6268- head-branch: ['\brefactor(s|ed)?\b']
6369
.github/workflows/issues-auto-manager.yml+7 -7
@@ -32,7 +32,7 @@ jobs:
3232 with:
3333 configuration-path: .github/issues-auto-labels.yml
3434 enable-versioned-regex: 0
3535 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
3636
3737 label-on-labels:
3838 name: 🏷️ Label Issues by Labels
@@ -46,7 +46,7 @@ jobs:
4646 uses: actions-cool/issues-helper@v3.6.0
4747 with:
4848 actions: 'add-labels'
4949 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
5050 labels: 'πŸ‘ Approved'
5151
5252 - name: ❌ Remove progress labels when issue is marked done or stale
@@ -56,7 +56,7 @@ jobs:
5656 uses: actions-cool/issues-helper@v3.6.0
5757 with:
5858 actions: 'remove-labels'
5959 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
6060 labels: 'πŸ§‘β€πŸ’» In Progress,πŸ€” Unsure,πŸ€” Under Consideration'
6161
6262 - name: ❌ Remove temporary labels when confirmed labels are added
@@ -66,7 +66,7 @@ jobs:
6666 uses: actions-cool/issues-helper@v3.6.0
6767 with:
6868 actions: 'remove-labels'
6969 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
7070 labels: 'πŸ€” Unsure,πŸ€” Under Consideration'
7171
7272 - name: ❌ Remove no bug labels when "πŸͺ² Confirmed" is added
@@ -76,7 +76,7 @@ jobs:
7676 uses: actions-cool/issues-helper@v3.6.0
7777 with:
7878 actions: 'remove-labels'
7979 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
8080 labels: 'βœ–οΈ Not Reproducible,βœ–οΈ Not A Bug'
8181
8282 remove-stale-label:
@@ -92,7 +92,7 @@ jobs:
9292 uses: actions-cool/issues-helper@v3.6.0
9393 with:
9494 actions: 'remove-labels'
9595 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
9696 issue-number: ${{ github.event.issue.number }}
9797 labels: '⚰️ Stale,πŸ•ΈοΈ Inactive,🚏 Awaiting User Response,πŸ›‘ No Response'
9898
@@ -113,4 +113,4 @@ jobs:
113113 uses: peaceiris/actions-label-commenter@v1.10.0
114114 with:
115115 config_file: .github/issues-auto-comments.yml
116116 github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
.github/workflows/issues-updates-on-merge.yml+1 -1
@@ -31,7 +31,7 @@ jobs:
3131 - name: Label Linked Issues
3232 id: label_linked_issues
3333 env:
3434 GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
3535 run: |
3636 for ISSUE in $(echo $issues | jq -r '.[]'); do
3737 if [ "${{ github.ref }}" == "refs/heads/staging" ]; then
.github/workflows/job-close-stale.yml+3 -3
@@ -22,7 +22,7 @@ jobs:
2222 # https://github.com/marketplace/actions/close-stale-issues
2323 uses: actions/stale@v9.1.0
2424 with:
2525 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
2626 days-before-stale: 183
2727 days-before-close: 7
2828 operations-per-run: 30
@@ -56,7 +56,7 @@ jobs:
5656 # https://github.com/marketplace/actions/close-stale-issues
5757 uses: actions/stale@v9.1.0
5858 with:
5959 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
6060 days-before-stale: 7
6161 days-before-close: 7
6262 operations-per-run: 30
@@ -83,7 +83,7 @@ jobs:
8383 # https://github.com/marketplace/actions/close-stale-issues
8484 uses: actions/stale@v9.1.0
8585 with:
8686 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
8787 days-before-stale: 7
8888 days-before-close: 7
8989 operations-per-run: 30
.github/workflows/on-close-handler.yml+1 -1
@@ -23,6 +23,6 @@ jobs:
2323 uses: actions-cool/issues-helper@v3.6.0
2424 with:
2525 actions: remove-labels
2626 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
2727 issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
2828 labels: '🚏 Awaiting User Response,πŸ§‘β€πŸ’» In Progress,πŸ“Œ Keep Open,🚫 Merge Conflicts,πŸ”¬ Needs Testing,πŸ”¨ Needs Work,⚰️ Stale,β›” Waiting For External/Upstream'
.github/workflows/on-open-handler.yml+1 -1
@@ -24,6 +24,6 @@ jobs:
2424 uses: actions-cool/issues-helper@v3.6.0
2525 with:
2626 actions: 'add-labels'
2727 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
2828 issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
2929 labels: 'πŸ‘· Maintainer'
.github/workflows/pr-auto-manager.yml+27 -12
@@ -14,14 +14,22 @@ jobs:
1414 label-by-size:
1515 name: 🏷️ Label PR by Size
1616 runs-on: ubuntu-latest
17+ # Only needs to run when code is changed
18+ if: github.event.action == 'opened' || github.event.action == 'synchronize'
19+
20+ # Override permissions, the labeler needs issues write access
21+ permissions:
22+ contents: read
23+ issues: write
24+ pull-requests: write
1725
1826 steps:
1927 - name: Label PR Size
2028 # Pull Request Size Labeler
2129 # https://github.com/marketplace/actions/pull-request-size-labeler
2230 uses: codelytv/pr-size-labeler@v1.10.12
2331 with:
2432 GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
2533 xs_label: '🟩 ⬀○○○○'
2634 xs_max_size: '20'
2735 s_label: '🟩 ⬀⬀○○○'
@@ -32,7 +40,6 @@ jobs:
3240 l_max_size: '1000'
3341 xl_label: 'πŸŸ₯ ⬀⬀⬀⬀⬀'
3442 fail_if_xl: 'false'
35- github_api_url: 'https://api.github.com'
3643 files_to_ignore: |
3744 "package-lock.json"
3845 "public/lib/*"
@@ -40,8 +47,8 @@ jobs:
4047 label-by-branches:
4148 name: 🏷️ Label PR by Branches
4249 runs-on: ubuntu-latest
4350 # Only label once when PR is created or brancheswhen arebase branch is changed, to allow manual label removal
4451 if: github.event.action == 'opened' || (github.event.action == 'synchronize' && (github.event.changes.base || github.event.changes.head))
4552
4653 steps:
4754 - name: Checkout Repository
@@ -55,11 +62,13 @@ jobs:
5562 uses: actions/labeler@v5.0.0
5663 with:
5764 configuration-path: .github/pr-auto-labels-by-branch.yml
5865 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
5966
6067 label-by-files:
6168 name: 🏷️ Label PR by Files
6269 runs-on: ubuntu-latest
70+ # Only needs to run when code is changed
71+ if: github.event.action == 'opened' || github.event.action == 'synchronize'
6372
6473 steps:
6574 - name: Checkout Repository
@@ -73,14 +82,20 @@ jobs:
7382 uses: actions/labeler@v5.0.0
7483 with:
7584 configuration-path: .github/pr-auto-labels-by-files.yml
7685 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
7786
7887 remove-stale-label:
7988 name: πŸ—‘οΈ Remove Stale Label on Comment
8089 runs-on: ubuntu-latest
8190 # Only runs when thison iscomments not done by the github actions bot
8291 if: github.event_name == 'pull_request_review_comment' && github.actor != 'github-actions[bot]'
8392
93+ # Override permissions, issue labeler needs issues write access
94+ permissions:
95+ contents: read
96+ issues: write
97+ pull-requests: write
98+
8499 steps:
85100 - name: Remove Stale Label
86101 # πŸ€– Issues Helper
@@ -88,7 +103,7 @@ jobs:
88103 uses: actions-cool/issues-helper@v3.6.0
89104 with:
90105 actions: 'remove-labels'
91106 token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
92107 issue-number: ${{ github.event.pull_request.number }}
93108 labels: '⚰️ Stale'
94109
@@ -161,7 +176,7 @@ jobs:
161176 uses: peaceiris/actions-label-commenter@v1.10.0
162177 with:
163178 config_file: .github/pr-auto-comments.yml
164179 github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
165180
166181 # 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.
167182 update-linked-issues:
@@ -182,7 +197,7 @@ jobs:
182197 PR_NUMBER=${{ github.event.pull_request.number }}
183198 REPO=${{ github.repository }}
184199 API_URL="https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/issues"
185200 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]')
186201 echo "linked_issues=$ISSUES" >> $GITHUB_ENV
187202
188203 - name: Merge Issue Lists
@@ -194,7 +209,7 @@ jobs:
194209 - name: Label Linked Issues
195210 id: label_linked_issues
196211 env:
197212 GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
198213 run: |
199214 for ISSUE in $(echo $final_issues | jq -r '.[]'); do
200215 gh issue edit $ISSUE -R ${{ github.repository }} --add-label "βœ… Done (staging)"
.github/workflows/pr-check-merge-conflicts.yaml+1 -1
@@ -23,6 +23,6 @@ jobs:
2323 uses: eps1lon/actions-label-merge-conflict@v3.0.3
2424 with:
2525 dirtyLabel: '🚫 Merge Conflicts'
2626 repoToken: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
2727 commentOnDirty: >
2828 ⚠️ This PR has conflicts that need to be resolved before it can be merged.