Nocigar commited on
Commit
aa00dab
·
verified ·
1 Parent(s): 6083bf4

Upload 10 files

Browse files
.github/workflows/add-comment-from-tag.yml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 }}
.github/workflows/check-merge-conflicts.yml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Detect and label pull requests that have merge conflicts
2
+ name: 🏗️ Check Merge Conflicts
3
+ on:
4
+ push:
5
+ branches:
6
+ - staging
7
+ jobs:
8
+ check-conflicts:
9
+ if: github.repository == 'SillyTavern/SillyTavern'
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: mschilde/auto-label-merge-conflicts@master
13
+ with:
14
+ CONFLICT_LABEL_NAME: "🚫 Merge Conflicts"
15
+ GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
16
+ MAX_RETRIES: 5
17
+ WAIT_MS: 5000
.github/workflows/close-stale-issues.yml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Closes any issues that no longer have user interaction
2
+ name: 🎯 Close Stale Issues
3
+
4
+ on:
5
+ workflow_dispatch:
6
+ schedule:
7
+ - cron: '0 0 * * *' # Runs every day at midnight UTC
8
+
9
+ jobs:
10
+ stale:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ # Comment on, then close issues that haven't been updated for ages
15
+ - name: Close Stale Issues
16
+ uses: actions/stale@v4
17
+ with:
18
+ repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
19
+ days-before-stale: 183
20
+ days-before-close: 7
21
+ operations-per-run: 30
22
+ remove-stale-when-updated: true
23
+ enable-statistics: true
24
+ stale-issue-message: >
25
+ This issue has gone 6 months without an update. To keep the ticket open, please indicate that it is still relevant in a comment below.
26
+ Otherwise it will be closed in 7 days.
27
+ stale-pr-message: >
28
+ This PR is stale because it has been open 6 months with no activity. Either remove the stale label or comment below with a short update,
29
+ otherwise this PR will be closed in 7 days.
30
+ close-issue-message: >
31
+ This issue was automatically closed because it has been stalled for over 6 months with no activity.
32
+ close-pr-message: >
33
+ This pull request was automatically closed because it has been stalled for over 6 months with no activity.
34
+ stale-issue-label: '⚰️ Stale'
35
+ close-issue-label: '🕸️ Inactive'
36
+ stale-pr-label: '⚰️ Stale'
37
+ close-pr-label: '🕸️ Inactive'
38
+ exempt-issue-labels: '📌 Keep Open'
39
+ exempt-pr-labels: '📌 Keep Open'
40
+ labels-to-add-when-unstale: '📌 Keep Open'
41
+
42
+ # Comment on, then close issues that required a response from the user, but didn't get one
43
+ - name: Close Issues without Response
44
+ uses: actions/stale@v4
45
+ with:
46
+ repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
47
+ days-before-stale: 7
48
+ days-before-close: 7
49
+ operations-per-run: 30
50
+ remove-stale-when-updated: true
51
+ stale-issue-message: >
52
+ Hi! Looks like additional info is required for this issue to be addressed.
53
+ Don't forget to provide this within the next few days to keep your ticket open.
54
+ close-issue-message: 'Issue closed due to no response from user.'
55
+ only-labels: '🚏 Awaiting User Response'
56
+ labels-to-remove-when-unstale: '🚏 Awaiting User Response, 🛑 No Response'
57
+ stale-issue-label: '🛑 No Response'
58
+ close-issue-label: '🕸️ Inactive'
59
+ exempt-issue-labels: '📌 Keep Open'
60
+ exempt-pr-labels: '📌 Keep Open'
61
+
62
+ # Comment on issues that we should have replied to
63
+ - name: Notify Repo Owner to Respond
64
+ uses: actions/stale@v4
65
+ with:
66
+ repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
67
+ days-before-stale: 7
68
+ days-before-close: 183
69
+ operations-per-run: 30
70
+ remove-stale-when-updated: true
71
+ stale-issue-message: Hey SillyTavern, - Don't forget to respond!
72
+ stale-pr-message: Hey SillyTavern, - Don't forget to respond!
73
+ only-labels: '👤 Awaiting Maintainer Response'
74
+ labels-to-remove-when-unstale: '👤 Awaiting Maintainer Response'
75
+ close-issue-message: 'Closed due to no response from repo author for over a year'
76
+ close-pr-message: 'Closed due to no response from repo author for over a year'
77
+ stale-issue-label: '👤 Awaiting Maintainer Response'
78
+ stale-pr-label: '👤 Awaiting Maintainer Response'
79
+ close-issue-label: '🕸️ Inactive'
80
+ close-pr-label: '🕸️ Inactive'
81
+ exempt-issue-labels: '📌 Keep Open'
82
+ exempt-pr-labels: '📌 Keep Open'
.github/workflows/docker-publish.yml ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow will publish a docker image for every full release to the GitHub package repository
2
+
3
+ name: Create Docker Image (Release and Staging)
4
+
5
+ on:
6
+ release:
7
+ # Allow pre-releases
8
+ types: [published]
9
+ schedule:
10
+ # Build the staging image everyday at 00:00 UTC
11
+ - cron: "0 0 * * *"
12
+ push:
13
+ # Temporary workaround
14
+ branches:
15
+ - release
16
+
17
+ env:
18
+ # This should allow creation of docker images even in forked repositories
19
+ REPO: ${{ github.repository }}
20
+ REGISTRY: ghcr.io
21
+
22
+ jobs:
23
+ build:
24
+ if: github.repository == 'SillyTavern/SillyTavern'
25
+ runs-on: ubuntu-latest
26
+
27
+ steps:
28
+ # Workaround for GitHub repo names containing uppercase characters
29
+ - name: Set lowercase repo name
30
+ run: |
31
+ echo "IMAGE_NAME=${REPO,,}" >> ${GITHUB_ENV}
32
+
33
+ # Using the following workaround because currently GitHub Actions
34
+ # does not support logical AND/OR operations on triggers
35
+ # It's currently not possible to have `branches` under the `schedule` trigger
36
+ - name: Checkout the release branch (on release)
37
+ if: ${{ github.event_name == 'release' || github.event_name == 'push' }}
38
+ uses: actions/[email protected]
39
+ with:
40
+ ref: "release"
41
+
42
+ - name: Checkout the staging branch
43
+ if: ${{ github.event_name == 'schedule' }}
44
+ uses: actions/[email protected]
45
+ with:
46
+ ref: "staging"
47
+
48
+ # Get current branch name
49
+ # This is also part of the workaround for Actions not allowing logical
50
+ # AND/OR operators on triggers
51
+ # Otherwise the action triggered by schedule always has ref_name = release
52
+ - name: Get the current branch name
53
+ run: |
54
+ echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> ${GITHUB_ENV}
55
+
56
+ # Setting up QEMU for multi-arch image build
57
+ - name: Set up QEMU
58
+ uses: docker/setup-qemu-action@v3
59
+
60
+ - name: Set up Docker Buildx
61
+ uses: docker/setup-buildx-action@v3
62
+
63
+ - name: Extract metadata (tags, labels) for the image
64
+ uses: docker/[email protected]
65
+ id: metadata
66
+ with:
67
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
68
+ # Release version tag if the workflow is triggered by a release
69
+ # Branch name tag if the workflow is triggered by a push
70
+ # Latest tag if the branch is release and the workflow is triggered by a push
71
+ tags: |
72
+ ${{ github.event_name == 'release' && github.ref_name || env.BRANCH_NAME }}
73
+ ${{ github.event_name == 'push' && env.BRANCH_NAME == 'release' && 'latest' || '' }}
74
+
75
+ # Login into package repository as the person who created the release
76
+ - name: Log in to the Container registry
77
+ uses: docker/login-action@v3
78
+ with:
79
+ registry: ${{ env.REGISTRY }}
80
+ username: ${{ github.actor }}
81
+ password: ${{ secrets.GITHUB_TOKEN }}
82
+
83
+ # Build docker image using dockerfile for amd64 and arm64
84
+ # Tag it with branch name
85
+ # Assumes branch name is the version number
86
+ - name: Build and push
87
+ uses: docker/[email protected]
88
+ with:
89
+ context: .
90
+ platforms: linux/amd64,linux/arm64
91
+ file: Dockerfile
92
+ push: true
93
+ tags: ${{ steps.metadata.outputs.tags }}
94
+ labels: ${{ steps.metadata.outputs.labels }}
.github/workflows/get-pr-size.yml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Adds a comment to new PRs, showing the compressed size and size difference of new code
2
+ # And also labels the PR based on the number of lines changes
3
+
4
+ name: 🌈 Check PR Size
5
+ on: [pull_request]
6
+ jobs:
7
+ build:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: Checkout
11
+ uses: actions/checkout@v2
12
+ # Find and comment with compressed size
13
+ - name: Get Compressed Size
14
+ uses: preactjs/compressed-size-action@v2
15
+ with:
16
+ repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
17
+ pattern: './dist/**/*.{js,css,html}'
18
+ strip-hash: '\\b\\w{8}\\.'
19
+ exclude: '**/node_modules/**'
20
+ minimum-change-threshold: 100
21
+ # Check number of lines of code added
22
+ - name: Label based on Lines of Code
23
+ uses: codelytv/pr-size-labeler@v1
24
+ with:
25
+ GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
26
+ xs_max_size: '10'
27
+ s_max_size: '100'
28
+ m_max_size: '500'
29
+ l_max_size: '1000'
30
+ s_label: '🟩 PR - Small'
31
+ m_label: '🟨 PR - Medium'
32
+ l_label: '🟧 PR - Large'
33
+ xl_label: '🟥 PR - XL'
34
+ fail_if_xl: 'false'
35
+ message_if_xl: >
36
+ It looks like this PR is very large (over 1000 lines).
37
+ Try to avoid addressing multiple issues in a single PR, and
38
+ in the future consider breaking large tasks down into smaller steps.
39
+ This it to make reviewing, testing, reverting and general quality management easier.
.github/workflows/labeler.yml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/[email protected]
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 }}
.github/workflows/manage-pending-labels-closed.yml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
2
+
3
+ name: 🎯 Remove Pending Labels on Close
4
+ on:
5
+ issues:
6
+ types: [closed]
7
+ jobs:
8
+ remove-labels:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Remove Labels when Closed
12
+ uses: actions-cool/issues-helper@v2
13
+ with:
14
+ actions: remove-labels
15
+ token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
16
+ issue-number: ${{ github.event.issue.number }}
17
+ labels: '🚏 Awaiting User Response,⚰️ Stale,👤 Awaiting Maintainer Response'
.github/workflows/manage-pending-labels.yml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
2
+
3
+ name: 🎯 Add/ Remove Awaiting Response Labels
4
+ on:
5
+ issue_comment:
6
+ types: [created]
7
+ jobs:
8
+ remove-stale:
9
+ runs-on: ubuntu-latest
10
+ if: ${{ github.event.comment.author_association != 'COLLABORATOR' && github.event.comment.author_association != 'OWNER' }}
11
+ steps:
12
+ - name: Remove Stale labels when Updated
13
+ uses: actions-cool/issues-helper@v2
14
+ with:
15
+ actions: remove-labels
16
+ token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
17
+ issue-number: ${{ github.event.issue.number }}
18
+ labels: '🚏 Awaiting User Response,⚰️ Stale'
19
+
20
+ add-awaiting-author:
21
+ runs-on: ubuntu-latest
22
+ if: ${{!github.event.issue.pull_request && github.event.comment.author_association != 'COLLABORATOR' && github.event.comment.author_association != 'OWNER' && github.event.issue.state == 'open' }}
23
+ steps:
24
+ - name: Add Awaiting Author labels when Updated
25
+ uses: actions-cool/issues-helper@v2
26
+ with:
27
+ actions: add-labels
28
+ token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
29
+ issue-number: ${{ github.event.issue.number }}
30
+ labels: '👤 Awaiting Maintainer Response'
31
+
32
+ remove-awaiting-author:
33
+ runs-on: ubuntu-latest
34
+ if: ${{ github.event.comment.author_association == 'OWNER' }}
35
+ steps:
36
+ - name: Remove Awaiting Author labels when Updated
37
+ uses: actions-cool/issues-helper@v2
38
+ with:
39
+ actions: remove-labels
40
+ token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
41
+ issue-number: ${{ github.event.issue.number }}
42
+ labels: '👤 Awaiting Maintainer Response'
.github/workflows/npm-publish.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 16
18
+ - run: npm ci
19
+
20
+ publish-npm:
21
+ needs: build
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v3
25
+ - uses: actions/setup-node@v3
26
+ with:
27
+ node-version: 16
28
+ registry-url: https://registry.npmjs.org/
29
+ - run: npm ci
30
+ - run: npm publish
31
+ env:
32
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
.github/workflows/update-i18n.yaml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Update i18n data
2
+
3
+ on: workflow_dispatch
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ permissions: # Job-level permissions configuration starts here
9
+ contents: write # 'write' access to repository contents
10
+ steps:
11
+ - name: disable auto crlf
12
+ uses: steve02081504/disable-autocrlf@v1
13
+ - uses: actions/checkout@v4
14
+ with:
15
+ ref: ${{ github.head_ref }}
16
+ fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
17
+ - name: Create local changes
18
+ run: |
19
+ aria2c https://raw.githubusercontent.com/SillyTavern/SillyTavern-i18n/main/generate.py
20
+ aria2c https://raw.githubusercontent.com/SillyTavern/SillyTavern-i18n/main/requirements.txt
21
+ pip install -r ./requirements.txt
22
+ python ./generate.py "" --sort-keys
23
+ rm -f ./generate.py ./requirements.txt
24
+ - name: add all
25
+ run: git add -A
26
+ - name: push
27
+ uses: actions-go/push@master
28
+ with:
29
+ author-email: 41898282+github-actions[bot]@users.noreply.github.com
30
+ author-name: github-actions[bot]
31
+ commit-message: 'i18n changes'
32
+ remote: origin