Skip to content

Commit 91f4882

Browse files
committed
feat: initial release
1 parent 64a572e commit 91f4882

22 files changed

+13982
-0
lines changed

.github/CODEOWNERS

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
* @xayanide
2+
# 3-3-2025 UTC+8 https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file
3+
# This is a comment.
4+
# Each line is a file pattern followed by one or more owners.
5+
6+
# These owners will be the default owners for everything in
7+
# the repo. Unless a later match takes precedence,
8+
# @global-owner1 and @global-owner2 will be requested for
9+
# review when someone opens a pull request.
10+
# * @global-owner1 @global-owner2
11+
12+
# Order is important; the last matching pattern takes the most
13+
# precedence. When someone opens a pull request that only
14+
# modifies JS files, only @js-owner and not the global
15+
# owner(s) will be requested for a review.
16+
# *.js @js-owner #This is an inline comment.
17+
18+
# You can also use email addresses if you prefer. They'll be
19+
# used to look up users just like we do for commit author
20+
# emails.
21+
22+
23+
# Teams can be specified as code owners as well. Teams should
24+
# be identified in the format @org/team-name. Teams must have
25+
# explicit write access to the repository. In this example,
26+
# the octocats team in the octo-org organization owns all .txt files.
27+
# *.txt @octo-org/octocats
28+
29+
# In this example, @doctocat owns any files in the build/logs
30+
# directory at the root of the repository and any of its
31+
# subdirectories.
32+
# /build/logs/ @doctocat
33+
34+
# The `docs/*` pattern will match files like
35+
# `docs/getting-started.md` but not further nested files like
36+
# `docs/build-app/troubleshooting.md`.
37+
38+
39+
# In this example, @octocat owns any file in an apps directory
40+
# anywhere in your repository.
41+
# apps/ @octocat
42+
43+
# In this example, @doctocat owns any file in the `/docs`
44+
# directory in the root of your repository and any of its
45+
# subdirectories.
46+
# /docs/ @doctocat
47+
48+
# In this example, any change inside the `/scripts` directory
49+
# will require approval from @doctocat or @octocat.
50+
# /scripts/ @doctocat @octocat
51+
52+
# In this example, @octocat owns any file in a `/logs` directory such as
53+
# `/build/logs`, `/scripts/logs`, and `/deeply/nested/logs`. Any changes
54+
# in a `/logs` directory will require approval from @octocat.
55+
# **/logs @octocat
56+
57+
# In this example, @octocat owns any file in the `/apps`
58+
# directory in the root of your repository except for the `/apps/github`
59+
# subdirectory, as its owners are left empty. Without an owner, changes
60+
# to `apps/github` can be made with the approval of any user who has
61+
# write access to the repository.
62+
# /apps/ @octocat
63+
# /apps/github
64+
65+
# In this example, @octocat owns any file in the `/apps`
66+
# directory in the root of your repository except for the `/apps/github`
67+
# subdirectory, as this subdirectory has its own owner @doctocat
68+
# /apps/ @octocat
69+
# /apps/github @doctocat

.github/FUNDING.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 3-3-2025 UTC+8 https://github.com/org/repo/new/mainbranch?repository_funding=1
2+
# These are supported funding model platforms
3+
4+
# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
5+
github:
6+
- xayanide
7+
# Replace with a single Patreon username
8+
patreon: xayanide
9+
# Replace with a single Open Collective username
10+
open_collective:
11+
# Replace with a single Ko-fi username
12+
ko_fi: xayanide
13+
# Replace with a single Tidelift platform-name/package-name e.g., npm/babel
14+
# tidelift:
15+
# Replace with a single Community Bridge project-name e.g., cloud-foundry
16+
# community_bridge:
17+
# Replace with a single Liberapay username
18+
# liberapay:
19+
# Replace with a single IssueHunt username
20+
# issuehunt:
21+
# Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
22+
# lfx_crowdfunding:
23+
# Replace with a single Polar username
24+
# polar:
25+
# Replace with a single Buy Me a Coffee username
26+
buy_me_a_coffee: xayanide
27+
# Replace with a single thanks.dev username
28+
# thanks_dev:
29+
# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
30+
custom:
31+
- "https://www.paypal.com/paypalme/xayanide"

.github/dependabot.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
version: 2
6+
updates:
7+
# Manage npm dependencies (package.json, package-lock.json)
8+
- package-ecosystem: npm
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10
13+
target-branch: dev
14+
versioning-strategy: increase
15+
labels:
16+
- enhancement
17+
# Manage GitHub Actions dependencies (used in .github/workflows/*.yml)
18+
- package-ecosystem: github-actions
19+
directory: "/"
20+
schedule:
21+
interval: daily
22+
open-pull-requests-limit: 10
23+
target-branch: dev
24+
labels:
25+
- enhancement

.github/workflows/branch-syncer.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: BranchSyncer
2+
on:
3+
workflow_run:
4+
workflows:
5+
- Releaser
6+
types:
7+
- completed
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: write
13+
14+
env:
15+
SOURCE_BRANCH: main
16+
TARGET_BRANCH: dev
17+
18+
jobs:
19+
sync-branch:
20+
name: Sync branch source into target
21+
runs-on: ubuntu-latest
22+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
token: ${{ secrets.SRGH_TOKEN }}
29+
- name: Configure git user
30+
run: |
31+
git config --global user.name "github-actions[bot]"
32+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
33+
- name: Sync branch source into target
34+
run: |
35+
set -e
36+
git fetch origin ${{ env.SOURCE_BRANCH }} ${{ env.TARGET_BRANCH }}
37+
git checkout ${{ env.TARGET_BRANCH }}
38+
git fetch origin ${{ env.TARGET_BRANCH }}
39+
git merge origin/${{ env.SOURCE_BRANCH }} || (echo "Merge conflict detected" && exit 1)
40+
git push origin ${{ env.TARGET_BRANCH }}

.github/workflows/codeql-scanner.yml

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: CodeQLScanner
13+
14+
on:
15+
push:
16+
branches:
17+
- main
18+
- dev
19+
pull_request:
20+
branches:
21+
- dev
22+
schedule:
23+
- cron: "18 12 * * 6"
24+
25+
jobs:
26+
perform-scan:
27+
name: Perform CodeQL ${{ matrix.language }} scan
28+
# Runner size impacts CodeQL analysis time. To learn more, please see:
29+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
30+
# - https://gh.io/supported-runners-and-hardware-resources
31+
# - https://gh.io/using-larger-runners (GitHub.com only)
32+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
33+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
34+
permissions:
35+
# required for all workflows
36+
security-events: write
37+
38+
# required to fetch internal or private CodeQL packs
39+
packages: read
40+
41+
# only required for workflows in private repositories
42+
actions: read
43+
contents: read
44+
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
include:
49+
- language: javascript-typescript
50+
build-mode: none
51+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
52+
# Use `c-cpp` to analyze code written in C, C++ or both
53+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
54+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
55+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
56+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
57+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
58+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v4
62+
63+
# Add any setup steps before running the `github/codeql-action/init` action.
64+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
65+
# or others). This is typically only required for manual builds.
66+
# - name: Setup runtime (example)
67+
# uses: actions/setup-example@v1
68+
69+
# Initializes the CodeQL tools for scanning.
70+
- name: Initialize CodeQL
71+
uses: github/codeql-action/init@v3
72+
with:
73+
languages: ${{ matrix.language }}
74+
build-mode: ${{ matrix.build-mode }}
75+
# If you wish to specify custom queries, you can do so here or in a config file.
76+
# By default, queries listed here will override any specified in a config file.
77+
# Prefix the list here with "+" to use these queries and those in the config file.
78+
79+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
80+
# queries: security-extended,security-and-quality
81+
82+
# If the analyze step fails for one of the languages you are analyzing with
83+
# "We were unable to automatically build your code", modify the matrix above
84+
# to set the build mode to "manual" for that language. Then modify this step
85+
# to build your code.
86+
# ℹ️ Command-line programs to run using the OS shell.
87+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
88+
# - if: matrix.build-mode == 'manual'
89+
# shell: bash
90+
# run: |
91+
# echo 'If you are using a "manual" build mode for one or more of the' \
92+
# 'languages you are analyzing, replace this with the commands to build' \
93+
# 'your code, for example:'
94+
# echo ' make bootstrap'
95+
# echo ' make release'
96+
# exit 1
97+
- name: Auto build CodeQL
98+
uses: github/codeql-action/autobuild@v3
99+
100+
- name: Perform CodeQL ${{ matrix.language }} scan
101+
uses: github/codeql-action/analyze@v3
102+
with:
103+
category: "/language:${{matrix.language}}"

.github/workflows/linters.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Linters
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- dev
7+
pull_request:
8+
branches:
9+
- dev
10+
11+
jobs:
12+
lint-commit:
13+
permissions: write-all
14+
name: Lint commit
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Lint commit
22+
uses: wagoid/commitlint-github-action@v6
23+
with:
24+
configFile: "./commitlint.config.mjs"
25+
lint-code:
26+
name: Lint code
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: read
30+
pull-requests: write
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: "lts/*"
38+
- name: Clean install NPM dependencies
39+
run: npm ci
40+
- name: Lint code
41+
uses: reviewdog/action-eslint@v1
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
reporter: github-check
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: PRAutoApprover
2+
on:
3+
pull_request_target:
4+
branches:
5+
- dev
6+
7+
permissions:
8+
pull-requests: write
9+
issues: write
10+
contents: write
11+
12+
jobs:
13+
approve-pr:
14+
name: Approve dependabot for non-major updates only
15+
if: github.event.pull_request.user.login == 'dependabot[bot]'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Fetch dependabot metadata
19+
id: dependabot-metadata
20+
uses: dependabot/fetch-metadata@v2
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
- name: Approve dependabot for non-major updates only
24+
if: steps.dependabot-metadata.outputs.dependabot == 'true' && steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major'
25+
run: |
26+
gh pr checkout "$PR_URL"
27+
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ];
28+
then gh pr review --approve "$PR_URL"
29+
else echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
30+
fi
31+
env:
32+
PR_URL: ${{ github.event.pull_request.html_url }}
33+
GITHUB_TOKEN: ${{ secrets.SRGH_TOKEN }}

.github/workflows/pr-auto-merger.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# https://github.com/reitermarkus/automerge?tab=readme-ov-file#example-workflow
2+
name: PRAutoMerger
3+
on:
4+
# Try enabling auto-merge for a pull request when a draft is marked as
5+
# “ready for review”, when a required label is applied or when a
6+
# “do not merge” label is removed, or when a pull request is updated in
7+
# any way (opened, synchronized, reopened, edited)
8+
pull_request_target:
9+
types:
10+
- opened
11+
- synchronize
12+
- reopened
13+
- edited
14+
- labeled
15+
- unlabeled
16+
- ready_for_review
17+
# Try enabling auto-merge for the specified pull request,
18+
# review or all open pull requests if none is specified.
19+
workflow_dispatch:
20+
inputs:
21+
pull-request:
22+
description: Pull Request Number
23+
required: false
24+
review:
25+
description: Review ID
26+
required: false
27+
28+
jobs:
29+
merge-pr:
30+
name: Enable auto-merge if PR is ready
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Enable auto-merge if PR is ready
34+
uses: reitermarkus/automerge@v2
35+
with:
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
merge-method: squash
38+
squash-commit-title: ${pull_request.title} (#${pull_request.number})
39+
do-not-merge-labels: question,invalid,help wanted,wontfix
40+
pull-request: ${{ github.event.inputs.pull-request }}
41+
review: ${{ github.event.inputs.review }}
42+
dry-run: false

0 commit comments

Comments
 (0)