Merge pull request #3719 from SillyTavern/fix-workflows-v2-v1.1

Fixing GitHub Workflows - again (maybe this time it works)
This commit is contained in:
Wolfsblvt
2025-03-18 19:51:26 +01:00
committed by GitHub
9 changed files with 49 additions and 28 deletions

View File

@@ -14,7 +14,7 @@
- '(🐧 Linux)' - '(🐧 Linux)'
🦊 Firefox: 🦊 Firefox:
- '(firefox|mozilla)' - '\b(firefox|mozilla)\b'
📱 Mobile: 📱 Mobile:
- '(iphone|ios|android|📱 Termux)' - '\b(iphone|ios|android|📱 Termux)\b'

View File

@@ -34,6 +34,9 @@
🦊 Firefox: 🦊 Firefox:
- head-branch: ['\bfirefox\b'] - head-branch: ['\bfirefox\b']
🧑‍🤝‍🧑 Group Chat:
- head-branch: ['\bgroups?\b']
🖼️ Image Gen: 🖼️ Image Gen:
- head-branch: ['\bimage-gen\b'] - head-branch: ['\bimage-gen\b']
@@ -58,6 +61,9 @@
📜 Prompt: 📜 Prompt:
- head-branch: ['\bprompt\b'] - head-branch: ['\bprompt\b']
🧠 Reasoning:
- head-branch: ['\breasoning\b', '\breason\b', '\bthinking\b']
🚚 Refactor: 🚚 Refactor:
- head-branch: ['\brefactor(s|ed)?\b'] - head-branch: ['\brefactor(s|ed)?\b']

View File

@@ -32,7 +32,7 @@ jobs:
with: with:
configuration-path: .github/issues-auto-labels.yml configuration-path: .github/issues-auto-labels.yml
enable-versioned-regex: 0 enable-versioned-regex: 0
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
label-on-labels: label-on-labels:
name: 🏷️ Label Issues by Labels name: 🏷️ Label Issues by Labels
@@ -46,7 +46,7 @@ jobs:
uses: actions-cool/issues-helper@v3.6.0 uses: actions-cool/issues-helper@v3.6.0
with: with:
actions: 'add-labels' actions: 'add-labels'
token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
labels: '👍 Approved' labels: '👍 Approved'
- name: ❌ Remove progress labels when issue is marked done or stale - name: ❌ Remove progress labels when issue is marked done or stale
@@ -56,7 +56,7 @@ jobs:
uses: actions-cool/issues-helper@v3.6.0 uses: actions-cool/issues-helper@v3.6.0
with: with:
actions: 'remove-labels' actions: 'remove-labels'
token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
labels: '🧑‍💻 In Progress,🤔 Unsure,🤔 Under Consideration' labels: '🧑‍💻 In Progress,🤔 Unsure,🤔 Under Consideration'
- name: ❌ Remove temporary labels when confirmed labels are added - name: ❌ Remove temporary labels when confirmed labels are added
@@ -66,7 +66,7 @@ jobs:
uses: actions-cool/issues-helper@v3.6.0 uses: actions-cool/issues-helper@v3.6.0
with: with:
actions: 'remove-labels' actions: 'remove-labels'
token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
labels: '🤔 Unsure,🤔 Under Consideration' labels: '🤔 Unsure,🤔 Under Consideration'
- name: ❌ Remove no bug labels when "🪲 Confirmed" is added - name: ❌ Remove no bug labels when "🪲 Confirmed" is added
@@ -76,7 +76,7 @@ jobs:
uses: actions-cool/issues-helper@v3.6.0 uses: actions-cool/issues-helper@v3.6.0
with: with:
actions: 'remove-labels' actions: 'remove-labels'
token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
labels: '✖️ Not Reproducible,✖️ Not A Bug' labels: '✖️ Not Reproducible,✖️ Not A Bug'
remove-stale-label: remove-stale-label:
@@ -92,7 +92,7 @@ jobs:
uses: actions-cool/issues-helper@v3.6.0 uses: actions-cool/issues-helper@v3.6.0
with: with:
actions: 'remove-labels' actions: 'remove-labels'
token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
labels: '⚰️ Stale,🕸️ Inactive,🚏 Awaiting User Response,🛑 No Response' labels: '⚰️ Stale,🕸️ Inactive,🚏 Awaiting User Response,🛑 No Response'
@@ -113,4 +113,4 @@ jobs:
uses: peaceiris/actions-label-commenter@v1.10.0 uses: peaceiris/actions-label-commenter@v1.10.0
with: with:
config_file: .github/issues-auto-comments.yml config_file: .github/issues-auto-comments.yml
github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -31,7 +31,7 @@ jobs:
- name: Label Linked Issues - name: Label Linked Issues
id: label_linked_issues id: label_linked_issues
env: env:
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
for ISSUE in $(echo $issues | jq -r '.[]'); do for ISSUE in $(echo $issues | jq -r '.[]'); do
if [ "${{ github.ref }}" == "refs/heads/staging" ]; then if [ "${{ github.ref }}" == "refs/heads/staging" ]; then

View File

@@ -22,7 +22,7 @@ jobs:
# https://github.com/marketplace/actions/close-stale-issues # https://github.com/marketplace/actions/close-stale-issues
uses: actions/stale@v9.1.0 uses: actions/stale@v9.1.0
with: with:
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 183 days-before-stale: 183
days-before-close: 7 days-before-close: 7
operations-per-run: 30 operations-per-run: 30
@@ -56,7 +56,7 @@ jobs:
# https://github.com/marketplace/actions/close-stale-issues # https://github.com/marketplace/actions/close-stale-issues
uses: actions/stale@v9.1.0 uses: actions/stale@v9.1.0
with: with:
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 7 days-before-stale: 7
days-before-close: 7 days-before-close: 7
operations-per-run: 30 operations-per-run: 30
@@ -83,7 +83,7 @@ jobs:
# https://github.com/marketplace/actions/close-stale-issues # https://github.com/marketplace/actions/close-stale-issues
uses: actions/stale@v9.1.0 uses: actions/stale@v9.1.0
with: with:
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 7 days-before-stale: 7
days-before-close: 7 days-before-close: 7
operations-per-run: 30 operations-per-run: 30

View File

@@ -23,6 +23,6 @@ jobs:
uses: actions-cool/issues-helper@v3.6.0 uses: actions-cool/issues-helper@v3.6.0
with: with:
actions: remove-labels actions: remove-labels
token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number || github.event.pull_request.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' labels: '🚏 Awaiting User Response,🧑‍💻 In Progress,📌 Keep Open,🚫 Merge Conflicts,🔬 Needs Testing,🔨 Needs Work,⚰️ Stale,⛔ Waiting For External/Upstream'

View File

@@ -24,6 +24,6 @@ jobs:
uses: actions-cool/issues-helper@v3.6.0 uses: actions-cool/issues-helper@v3.6.0
with: with:
actions: 'add-labels' actions: 'add-labels'
token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
labels: '👷 Maintainer' labels: '👷 Maintainer'

View File

@@ -14,14 +14,22 @@ jobs:
label-by-size: label-by-size:
name: 🏷️ Label PR by Size name: 🏷️ Label PR by Size
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Only needs to run when code is changed
if: github.event.action == 'opened' || github.event.action == 'synchronize'
# Override permissions, the labeler needs issues write access
permissions:
contents: read
issues: write
pull-requests: write
steps: steps:
- name: Label PR Size - name: Label PR Size
# Pull Request Size Labeler # Pull Request Size Labeler
# https://github.com/marketplace/actions/pull-request-size-labeler # https://github.com/marketplace/actions/pull-request-size-labeler
uses: codelytv/pr-size-labeler@v1.10.1 uses: codelytv/pr-size-labeler@v1.10.2
with: with:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: '🟩 ⬤○○○○' xs_label: '🟩 ⬤○○○○'
xs_max_size: '20' xs_max_size: '20'
s_label: '🟩 ⬤⬤○○○' s_label: '🟩 ⬤⬤○○○'
@@ -32,7 +40,6 @@ jobs:
l_max_size: '1000' l_max_size: '1000'
xl_label: '🟥 ⬤⬤⬤⬤⬤' xl_label: '🟥 ⬤⬤⬤⬤⬤'
fail_if_xl: 'false' fail_if_xl: 'false'
github_api_url: 'https://api.github.com'
files_to_ignore: | files_to_ignore: |
"package-lock.json" "package-lock.json"
"public/lib/*" "public/lib/*"
@@ -40,8 +47,8 @@ jobs:
label-by-branches: label-by-branches:
name: 🏷️ Label PR by Branches name: 🏷️ Label PR by Branches
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Only label once when PR is created or branches are changed, to allow manual label removal # Only label once when PR is created or when base branch is changed, to allow manual label removal
if: github.event.action == 'opened' || (github.event.action == 'synchronize' && (github.event.changes.base || github.event.changes.head)) if: github.event.action == 'opened' || (github.event.action == 'synchronize' && github.event.changes.base)
steps: steps:
- name: Checkout Repository - name: Checkout Repository
@@ -55,11 +62,13 @@ jobs:
uses: actions/labeler@v5.0.0 uses: actions/labeler@v5.0.0
with: with:
configuration-path: .github/pr-auto-labels-by-branch.yml configuration-path: .github/pr-auto-labels-by-branch.yml
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
label-by-files: label-by-files:
name: 🏷️ Label PR by Files name: 🏷️ Label PR by Files
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Only needs to run when code is changed
if: github.event.action == 'opened' || github.event.action == 'synchronize'
steps: steps:
- name: Checkout Repository - name: Checkout Repository
@@ -73,14 +82,20 @@ jobs:
uses: actions/labeler@v5.0.0 uses: actions/labeler@v5.0.0
with: with:
configuration-path: .github/pr-auto-labels-by-files.yml configuration-path: .github/pr-auto-labels-by-files.yml
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
remove-stale-label: remove-stale-label:
name: 🗑️ Remove Stale Label on Comment name: 🗑️ Remove Stale Label on Comment
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Only runs when this is not done by the github actions bot # Only runs on comments not done by the github actions bot
if: github.event_name == 'pull_request_review_comment' && github.actor != 'github-actions[bot]' if: github.event_name == 'pull_request_review_comment' && github.actor != 'github-actions[bot]'
# Override permissions, issue labeler needs issues write access
permissions:
contents: read
issues: write
pull-requests: write
steps: steps:
- name: Remove Stale Label - name: Remove Stale Label
# 🤖 Issues Helper # 🤖 Issues Helper
@@ -88,7 +103,7 @@ jobs:
uses: actions-cool/issues-helper@v3.6.0 uses: actions-cool/issues-helper@v3.6.0
with: with:
actions: 'remove-labels' actions: 'remove-labels'
token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }} issue-number: ${{ github.event.pull_request.number }}
labels: '⚰️ Stale' labels: '⚰️ Stale'
@@ -161,7 +176,7 @@ jobs:
uses: peaceiris/actions-label-commenter@v1.10.0 uses: peaceiris/actions-label-commenter@v1.10.0
with: with:
config_file: .github/pr-auto-comments.yml config_file: .github/pr-auto-comments.yml
github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} 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. # 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: update-linked-issues:
@@ -182,7 +197,7 @@ jobs:
PR_NUMBER=${{ github.event.pull_request.number }} PR_NUMBER=${{ github.event.pull_request.number }}
REPO=${{ github.repository }} REPO=${{ github.repository }}
API_URL="https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/issues" 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]') ISSUES=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$API_URL" | jq -r '.[].number' | jq -R -s -c 'split("\n")[:-1]')
echo "linked_issues=$ISSUES" >> $GITHUB_ENV echo "linked_issues=$ISSUES" >> $GITHUB_ENV
- name: Merge Issue Lists - name: Merge Issue Lists
@@ -194,7 +209,7 @@ jobs:
- name: Label Linked Issues - name: Label Linked Issues
id: label_linked_issues id: label_linked_issues
env: env:
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
for ISSUE in $(echo $final_issues | jq -r '.[]'); do for ISSUE in $(echo $final_issues | jq -r '.[]'); do
gh issue edit $ISSUE -R ${{ github.repository }} --add-label "✅ Done (staging)" gh issue edit $ISSUE -R ${{ github.repository }} --add-label "✅ Done (staging)"

View File

@@ -23,6 +23,6 @@ jobs:
uses: eps1lon/actions-label-merge-conflict@v3.0.3 uses: eps1lon/actions-label-merge-conflict@v3.0.3
with: with:
dirtyLabel: '🚫 Merge Conflicts' dirtyLabel: '🚫 Merge Conflicts'
repoToken: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} repoToken: ${{ secrets.GITHUB_TOKEN }}
commentOnDirty: > commentOnDirty: >
⚠️ This PR has conflicts that need to be resolved before it can be merged. ⚠️ This PR has conflicts that need to be resolved before it can be merged.