Skip to content

Commit ffc626e

Browse files
committed
chore: initial commit
0 parents  commit ffc626e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+14019
-0
lines changed

.gitattributes

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#example
2+
# Set the default behavior, in case people don't have core.autocrlf set.
3+
* text=auto
4+
5+
# Explicitly declare text files you want to always be normalized and converted
6+
# to native line endings on checkout.
7+
*.c text
8+
*.h text
9+
10+
# Declare files that will always have CRLF line endings on checkout.
11+
*.sln text eol=crlf
12+
13+
# Denote all files that are truly binary and should not be modified.
14+
*.png binary
15+
*.jpg binary

.github/dependabot.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
- "approved"
18+
# Manage GitHub Actions dependencies (used in .github/workflows/*.yml)
19+
- package-ecosystem: github-actions
20+
directory: "/"
21+
schedule:
22+
interval: daily
23+
open-pull-requests-limit: 10
24+
target-branch: dev
25+
labels:
26+
- "enhancement"
27+
- "approved"

.github/workflows/branch-syncer.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: BranchSyncer
2+
on:
3+
workflow_run:
4+
workflows: [VersionReleaser]
5+
types: [completed]
6+
branches: [main]
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
sync-branch:
13+
name: Sync branch 'dev' with 'main'
14+
runs-on: ubuntu-latest
15+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
token: ${{ secrets.SRGH_TOKEN }}
22+
- name: Sync branch 'dev' with 'main'
23+
run: |
24+
git checkout main
25+
git fetch origin
26+
git checkout dev
27+
git pull --rebase
28+
git merge origin/main
29+
git push origin dev

.github/workflows/codeql-scanner.yml

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

.github/workflows/linters.yml

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

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

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PRAutoMerger
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
- synchronize
7+
- reopened
8+
- edited
9+
- labeled
10+
- unlabeled
11+
- ready_for_review
12+
workflow_dispatch:
13+
inputs:
14+
pull-request:
15+
description: Choose a pull request number
16+
required: false
17+
18+
jobs:
19+
merge-pr:
20+
name: Enable auto-merge if PR is ready
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Enable auto-merge if PR is ready
24+
uses: reitermarkus/automerge@v2
25+
with:
26+
token: ${{ secrets.SRGH_TOKEN }}
27+
merge-method: squash
28+
squash-commit-title: ${pull_request.title} (#${pull_request.number})
29+
do-not-merge-labels: 'hold'
30+
required-labels: 'approved'
31+
pull-request: ${{ github.event.inputs.pull-request }}
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# https://semantic-release.gitbook.io/semantic-release/recipes/ci-configurations/github-actions
2+
name: VersionReleaser
3+
on:
4+
push:
5+
branches: [main, dev]
6+
7+
permissions:
8+
# for checkout
9+
contents: read
10+
11+
jobs:
12+
release-version:
13+
name: Bump and release if needed
14+
runs-on: ubuntu-latest
15+
permissions:
16+
# to be able to publish a GitHub release
17+
contents: write
18+
# to be able to comment on released issues
19+
issues: write
20+
# to be able to comment on released pull requests
21+
pull-requests: write
22+
# to enable use of OIDC for npm provenance
23+
id-token: write
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
# Test: https://github.com/semantic-release/semantic-release/discussions/2557
30+
persist-credentials: false
31+
- name: Setup Node.js LTS
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: "lts/*"
35+
- name: Clean install NPM dependencies
36+
# npm ci (clean-install) removes the existing node_modules directory
37+
run: npm ci
38+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
39+
run: npm audit signatures
40+
- name: Bump and release if needed
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.SRGH_TOKEN }}
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
run: npx semantic-release

0 commit comments

Comments
 (0)