Skip to content

Commit 3b385a9

Browse files
Initial commit
0 parents  commit 3b385a9

Some content is hidden

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

52 files changed

+35461
-0
lines changed

.cspell.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3+
"version": "0.2",
4+
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts", "dist"],
5+
"useGitignore": true,
6+
"language": "en",
7+
"words": [
8+
"Nektos",
9+
"dataurl",
10+
"devpool",
11+
"outdir",
12+
"servedir",
13+
"Supabase",
14+
"SUPABASE",
15+
"typebox",
16+
"ubiquibot",
17+
"Smee",
18+
"typeguards",
19+
"mswjs",
20+
"Typeguards",
21+
"sonarjs",
22+
"knip",
23+
"mischeck"
24+
],
25+
"dictionaries": ["typescript", "node", "software-terms"],
26+
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
27+
"ignoreRegExpList": ["[0-9a-fA-F]{6}"]
28+
}

.dev.vars.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MY_SECRET="MY_SECRET"

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MY_SECRET="MY_SECRET"

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/** linguist-generated
2+
bun.lockb linguist-generated

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.github/knip.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { KnipConfig } from "knip";
2+
3+
const config: KnipConfig = {
4+
entry: ["src/action.ts", "src/worker.ts"],
5+
project: ["src/", "test/"],
6+
ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"],
7+
ignoreExportsUsedInFile: true,
8+
// eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest
9+
ignoreDependencies: ["ts-node"],
10+
eslint: true,
11+
};
12+
13+
export default config;

.github/pull_request_template.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Resolves #
2+
3+
<!--
4+
- You must link the issue number e.g. "Resolves #1234"
5+
- Please do not replace the keyword "Resolves" https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
6+
-->

.github/workflows/compute.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "the name of the plugin"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
stateId:
7+
description: "State Id"
8+
eventName:
9+
description: "Event Name"
10+
eventPayload:
11+
description: "Event Payload"
12+
settings:
13+
description: "Settings"
14+
authToken:
15+
description: "Auth Token"
16+
ref:
17+
description: "Ref"
18+
signature:
19+
description: "The kernel signature"
20+
command:
21+
description: "Command from the Kernel"
22+
required: false
23+
24+
jobs:
25+
compute:
26+
name: "plugin name"
27+
runs-on: ubuntu-latest
28+
permissions: write-all
29+
environment: ${{ github.ref == 'refs/heads/main' && 'main' || 'development' }}
30+
env:
31+
PLUGIN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
KERNEL_PUBLIC_KEY: ${{ secrets.KERNEL_PUBLIC_KEY }}
33+
LOG_LEVEL: ${{ secrets.LOG_LEVEL || 'info' }}
34+
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
35+
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- uses: oven-sh/setup-bun@v2
41+
with:
42+
bun-version: latest
43+
44+
- name: execute directive
45+
run: bun ./dist/index.js
46+
id: plugin-name
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Conventional Commits
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
conventional-commits:
8+
name: Conventional Commits
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: ubiquity/action-conventional-commits@master
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Formatting Check
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
spellcheck:
9+
name: Check for formatting errors
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Bun
17+
uses: oven-sh/setup-bun@v2
18+
19+
- name: Run formatting checks
20+
run: |
21+
bun install
22+
bun eslint --fix-dry-run --ignore-pattern dist/
23+
bun format:cspell
24+
bun prettier --check .

.github/workflows/jest-testing.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Run Jest testing suite
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
6+
env:
7+
NODE_ENV: "test"
8+
9+
jobs:
10+
testing:
11+
permissions: write-all
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: oven-sh/setup-bun@v2
15+
with:
16+
bun-version: latest
17+
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Jest With Coverage
23+
run: |
24+
bun install --frozen-lockfile
25+
bun run test
26+
27+
- name: Add Jest Report to Summary
28+
if: always()
29+
run: echo "$(cat test-dashboard.md)" >> $GITHUB_STEP_SUMMARY

.github/workflows/knip-reporter.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Knip-reporter
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Knip"]
6+
types:
7+
- completed
8+
9+
permissions: write-all
10+
11+
jobs:
12+
knip-reporter:
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.workflow_run.conclusion != 'success' }}
15+
steps:
16+
- uses: actions/download-artifact@v4
17+
with:
18+
name: knip-results
19+
run-id: ${{ github.event.workflow_run.id }}
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Read pr number
23+
id: pr-number
24+
uses: juliangruber/read-file-action@v1
25+
with:
26+
path: ./pr-number.txt
27+
trim: true
28+
29+
- name: Report knip results to pull request
30+
uses: gitcoindev/knip-reporter@main
31+
with:
32+
verbose: true
33+
comment_id: ${{ github.workflow }}-reporter
34+
command_script_name: knip-ci
35+
annotations: true
36+
ignore_results: false
37+
json_input: true
38+
json_input_file_name: knip-results.json
39+
pull_request_number: ${{ steps.pr-number.outputs.content }}
40+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/knip.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Knip
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
run-knip:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Bun
15+
uses: oven-sh/setup-bun@v2
16+
17+
- name: Install toolchain
18+
run: bun install
19+
20+
- name: Store PR number
21+
run: echo ${{ github.event.number }} > pr-number.txt
22+
23+
- name: Run Knip
24+
run: bun run knip || bun run knip --reporter json > knip-results.json
25+
26+
- name: Upload knip result
27+
if: failure()
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: knip-results
31+
path: |
32+
knip-results.json
33+
pr-number.txt

.github/workflows/release-please.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: release-please
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
with:
19+
release-type: simple
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Update Configuration and Build"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
update:
9+
name: "Update Configuration & Build"
10+
runs-on: ubuntu-latest
11+
permissions: write-all
12+
13+
steps:
14+
- uses: ubiquity-os/action-deploy-plugin@main
15+
with:
16+
treatAsEsm: true
17+
sourcemap: false
18+
pluginEntry: "${{ github.workspace }}/src/action.ts"
19+
env:
20+
APP_ID: ${{ secrets.APP_ID }}
21+
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}

.github/workflows/worker-delete.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Delete Deployment
2+
3+
on:
4+
delete:
5+
6+
jobs:
7+
delete:
8+
runs-on: ubuntu-latest
9+
name: Delete Deployment
10+
environment: ${{ (github.ref == 'refs/heads/main' || github.event.workflow_run.head_branch == 'main') && 'main' || 'development' }}
11+
steps:
12+
- name: Setup Bun
13+
uses: oven-sh/setup-bun@v2
14+
15+
- uses: actions/checkout@v4
16+
17+
- name: Get Deleted Branch Name
18+
id: get_branch
19+
run: |
20+
branch_name=$(echo '${{ github.event.workflow_run.head_branch || github.ref }}' | sed 's#refs/heads/##' | sed 's#[^a-zA-Z0-9]#-#g')
21+
echo "branch_name=$branch_name" >> $GITHUB_ENV
22+
- name: Retrieve and Construct Full Worker Name
23+
id: construct_worker_name
24+
run: |
25+
base_name=$(grep '^name = ' wrangler.toml | head -n 1 | sed 's/^name = "\(.*\)"$/\1/')
26+
full_worker_name="${base_name}-${{ env.branch_name }}"
27+
# Make sure that it doesnt exceed 63 characters or it will break RFC 1035
28+
full_worker_name=$(echo "${full_worker_name}" | cut -c 1-63)
29+
echo "full_worker_name=$full_worker_name" >> $GITHUB_ENV
30+
- name: Delete Deployment with Wrangler
31+
uses: cloudflare/wrangler-action@v3
32+
with:
33+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
34+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
35+
command: delete --name ${{ env.full_worker_name }}
36+
37+
- name: Output Deletion Result
38+
run: |
39+
echo "### Deployment URL" >> $GITHUB_STEP_SUMMARY
40+
echo 'Deployment `${{ env.full_worker_name }}` has been deleted.' >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)