generated from nhcarrigan/template
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b16193f05c | |||
| ff0a60e575 | |||
| 869405bd20 | |||
| d5ef2efdbc | |||
| a9dd7a88a0 | |||
| 5faea25fbd | |||
| a9c7ebf74d | |||
|
0b19d91444
|
|||
|
74bccd903d
|
|||
|
402acffb5c
|
|||
| a8a58faf3c | |||
| 579dfe96f5 | |||
| 47dd385f05 | |||
| 2851693a70 | |||
| 6ee8189edd | |||
| aaa710eba4 | |||
|
e6112f57cb
|
|||
|
72b7571b92
|
|||
| 6e35d49a34 | |||
|
9c53c22130
|
|||
|
9d9d0809d7
|
|||
|
53274ec38c
|
|||
| 9ada4b9cbe | |||
| 34d71c73aa | |||
| 532461202a | |||
| 50e46368ed |
+15
-6
@@ -8,22 +8,31 @@ on:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint and Test
|
||||
ci:
|
||||
name: CI
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Files
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js v22
|
||||
- name: Use Node.js v24
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
- name: Ensure Dependencies are Pinned
|
||||
uses: naomi-lgbt/dependency-pin-check@main
|
||||
with:
|
||||
language: javascript
|
||||
dev-dependencies: true
|
||||
peer-dependencies: true
|
||||
optional-dependencies: true
|
||||
|
||||
- name: Install Dependencies
|
||||
run: pnpm install
|
||||
@@ -35,4 +44,4 @@ jobs:
|
||||
run: pnpm run build
|
||||
|
||||
- name: Run Tests
|
||||
run: pnpm run test
|
||||
run: pnpm run test
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
name: Security Scan and Upload
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
schedule:
|
||||
- cron: '0 0 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
security-audit:
|
||||
name: Security & DefectDojo Upload
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# --- AUTO-SETUP PROJECT ---
|
||||
- name: Ensure DefectDojo Product Exists
|
||||
env:
|
||||
DD_URL: ${{ secrets.DD_URL }}
|
||||
DD_TOKEN: ${{ secrets.DD_TOKEN }}
|
||||
PRODUCT_NAME: ${{ github.repository }}
|
||||
PRODUCT_TYPE_ID: 1
|
||||
run: |
|
||||
sudo apt-get install jq -y > /dev/null
|
||||
|
||||
echo "Checking connection to $DD_URL..."
|
||||
|
||||
# Check if product exists - capture HTTP code to debug connection issues
|
||||
RESPONSE=$(curl --write-out "%{http_code}" --silent --output /tmp/response.json \
|
||||
-H "Authorization: Token $DD_TOKEN" \
|
||||
"$DD_URL/api/v2/products/?name=$PRODUCT_NAME")
|
||||
|
||||
# If response is not 200, print error
|
||||
if [ "$RESPONSE" != "200" ]; then
|
||||
echo "::error::Failed to query DefectDojo. HTTP Code: $RESPONSE"
|
||||
cat /tmp/response.json
|
||||
exit 1
|
||||
fi
|
||||
|
||||
COUNT=$(cat /tmp/response.json | jq -r '.count')
|
||||
|
||||
if [ "$COUNT" = "0" ]; then
|
||||
echo "Creating product '$PRODUCT_NAME'..."
|
||||
curl -s -X POST "$DD_URL/api/v2/products/" \
|
||||
-H "Authorization: Token $DD_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{ "name": "'"$PRODUCT_NAME"'", "description": "Auto-created by Gitea Actions", "prod_type": '$PRODUCT_TYPE_ID' }'
|
||||
else
|
||||
echo "Product '$PRODUCT_NAME' already exists."
|
||||
fi
|
||||
|
||||
# --- 1. TRIVY (Dependencies & Misconfig) ---
|
||||
- name: Install Trivy
|
||||
run: |
|
||||
sudo apt-get install wget apt-transport-https gnupg lsb-release -y
|
||||
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
|
||||
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
|
||||
sudo apt-get update && sudo apt-get install trivy -y
|
||||
|
||||
- name: Run Trivy (FS Scan)
|
||||
run: |
|
||||
trivy fs . --scanners vuln,misconfig --format json --output trivy-results.json --exit-code 0
|
||||
|
||||
- name: Upload Trivy to DefectDojo
|
||||
env:
|
||||
DD_URL: ${{ secrets.DD_URL }}
|
||||
DD_TOKEN: ${{ secrets.DD_TOKEN }}
|
||||
run: |
|
||||
echo "Uploading Trivy results..."
|
||||
# Generate today's date in YYYY-MM-DD format
|
||||
TODAY=$(date +%Y-%m-%d)
|
||||
|
||||
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
|
||||
-H "Authorization: Token $DD_TOKEN" \
|
||||
-F "active=true" \
|
||||
-F "verified=true" \
|
||||
-F "scan_type=Trivy Scan" \
|
||||
-F "engagement_name=CI/CD Pipeline" \
|
||||
-F "product_name=${{ github.repository }}" \
|
||||
-F "scan_date=$TODAY" \
|
||||
-F "auto_create_context=true" \
|
||||
-F "file=@trivy-results.json")
|
||||
|
||||
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
|
||||
echo "::error::Upload Failed with HTTP $HTTP_CODE"
|
||||
echo "--- SERVER RESPONSE ---"
|
||||
cat response.txt
|
||||
echo "-----------------------"
|
||||
exit 1
|
||||
else
|
||||
echo "Upload Success!"
|
||||
fi
|
||||
|
||||
# --- 2. GITLEAKS (Secrets) ---
|
||||
- name: Install Gitleaks
|
||||
run: |
|
||||
wget -qO gitleaks.tar.gz https://github.com/gitleaks/gitleaks/releases/download/v8.18.0/gitleaks_8.18.0_linux_x64.tar.gz
|
||||
tar -xzf gitleaks.tar.gz
|
||||
sudo mv gitleaks /usr/local/bin/ && chmod +x /usr/local/bin/gitleaks
|
||||
|
||||
- name: Run Gitleaks
|
||||
run: gitleaks detect --source . -v --report-path gitleaks-results.json --report-format json --no-git || true
|
||||
|
||||
- name: Upload Gitleaks to DefectDojo
|
||||
env:
|
||||
DD_URL: ${{ secrets.DD_URL }}
|
||||
DD_TOKEN: ${{ secrets.DD_TOKEN }}
|
||||
run: |
|
||||
echo "Uploading Gitleaks results..."
|
||||
TODAY=$(date +%Y-%m-%d)
|
||||
|
||||
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
|
||||
-H "Authorization: Token $DD_TOKEN" \
|
||||
-F "active=true" \
|
||||
-F "verified=true" \
|
||||
-F "scan_type=Gitleaks Scan" \
|
||||
-F "engagement_name=CI/CD Pipeline" \
|
||||
-F "product_name=${{ github.repository }}" \
|
||||
-F "scan_date=$TODAY" \
|
||||
-F "auto_create_context=true" \
|
||||
-F "file=@gitleaks-results.json")
|
||||
|
||||
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
|
||||
echo "::error::Upload Failed with HTTP $HTTP_CODE"
|
||||
echo "--- SERVER RESPONSE ---"
|
||||
cat response.txt
|
||||
echo "-----------------------"
|
||||
exit 1
|
||||
else
|
||||
echo "Upload Success!"
|
||||
fi
|
||||
|
||||
# --- 3. SEMGREP (SAST) ---
|
||||
- name: Install Semgrep (via pipx)
|
||||
run: |
|
||||
sudo apt-get install pipx -y
|
||||
pipx install semgrep
|
||||
# Add pipx binary path to GITHUB_PATH so next steps can see 'semgrep'
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Run Semgrep
|
||||
run: semgrep scan --config=p/security-audit --config=p/owasp-top-ten --json --output semgrep-results.json . || true
|
||||
|
||||
- name: Upload Semgrep to DefectDojo
|
||||
env:
|
||||
DD_URL: ${{ secrets.DD_URL }}
|
||||
DD_TOKEN: ${{ secrets.DD_TOKEN }}
|
||||
run: |
|
||||
echo "Uploading Semgrep results..."
|
||||
TODAY=$(date +%Y-%m-%d)
|
||||
|
||||
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
|
||||
-H "Authorization: Token $DD_TOKEN" \
|
||||
-F "active=true" \
|
||||
-F "verified=true" \
|
||||
-F "scan_type=Semgrep JSON Report" \
|
||||
-F "engagement_name=CI/CD Pipeline" \
|
||||
-F "product_name=${{ github.repository }}" \
|
||||
-F "scan_date=$TODAY" \
|
||||
-F "auto_create_context=true" \
|
||||
-F "file=@semgrep-results.json")
|
||||
|
||||
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
|
||||
echo "::error::Upload Failed with HTTP $HTTP_CODE"
|
||||
echo "--- SERVER RESPONSE ---"
|
||||
cat response.txt
|
||||
echo "-----------------------"
|
||||
exit 1
|
||||
else
|
||||
echo "Upload Success!"
|
||||
fi
|
||||
@@ -0,0 +1,25 @@
|
||||
# Package Manager Configuration
|
||||
# Force pnpm usage - breaks npm/yarn intentionally
|
||||
node-linker=pnpm
|
||||
|
||||
# Security: Disable all lifecycle scripts
|
||||
ignore-scripts=true
|
||||
enable-pre-post-scripts=false
|
||||
|
||||
# Security: Require packages to be 10+ days old before installation
|
||||
minimum-release-age=14400
|
||||
|
||||
# Security: Verify package integrity hashes
|
||||
verify-store-integrity=true
|
||||
|
||||
# Security: Enforce strict trust policies
|
||||
trust-policy=strict
|
||||
|
||||
# Security: Strict peer dependency resolution
|
||||
strict-peer-dependencies=true
|
||||
|
||||
# Performance: Use symlinks for node_modules
|
||||
symlink=true
|
||||
|
||||
# Lockfile: Ensure lockfile is not modified during install
|
||||
frozen-lockfile=false
|
||||
@@ -18,7 +18,7 @@ This page is currently deployed. [View the live website.]
|
||||
|
||||
## Feedback and Bugs
|
||||
|
||||
If you have feedback or a bug report, please feel free to open a GitHub issue!
|
||||
If you have feedback or a bug report, please [log a ticket on our forum](https://support.nhcarrigan.com).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
"devDependencies": {
|
||||
"@nhcarrigan/eslint-config": "5.2.0",
|
||||
"@nhcarrigan/typescript-config": "4.0.0",
|
||||
"@types/node": "24.3.0",
|
||||
"@types/node": "25.2.3",
|
||||
"@types/node-schedule": "2.1.8",
|
||||
"eslint": "9.33.0",
|
||||
"typescript": "5.9.2"
|
||||
|
||||
Generated
+28
-28
@@ -35,13 +35,13 @@ importers:
|
||||
devDependencies:
|
||||
'@nhcarrigan/eslint-config':
|
||||
specifier: 5.2.0
|
||||
version: 5.2.0(@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(playwright@1.54.2)(react@19.1.1)(typescript@5.9.2)(vitest@3.2.4(@types/node@24.3.0))
|
||||
version: 5.2.0(@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(playwright@1.54.2)(react@19.1.1)(typescript@5.9.2)(vitest@3.2.4(@types/node@25.2.3))
|
||||
'@nhcarrigan/typescript-config':
|
||||
specifier: 4.0.0
|
||||
version: 4.0.0(typescript@5.9.2)
|
||||
'@types/node':
|
||||
specifier: 24.3.0
|
||||
version: 24.3.0
|
||||
specifier: 25.2.3
|
||||
version: 25.2.3
|
||||
'@types/node-schedule':
|
||||
specifier: 2.1.8
|
||||
version: 2.1.8
|
||||
@@ -646,8 +646,8 @@ packages:
|
||||
'@types/node-schedule@2.1.8':
|
||||
resolution: {integrity: sha512-k00g6Yj/oUg/CDC+MeLHUzu0+OFxWbIqrFfDiLi6OPKxTujvpv29mHGM8GtKr7B+9Vv92FcK/8mRqi1DK5f3hA==}
|
||||
|
||||
'@types/node@24.3.0':
|
||||
resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==}
|
||||
'@types/node@25.2.3':
|
||||
resolution: {integrity: sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ==}
|
||||
|
||||
'@types/normalize-package-data@2.4.4':
|
||||
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
|
||||
@@ -2238,8 +2238,8 @@ packages:
|
||||
resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
undici-types@7.10.0:
|
||||
resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==}
|
||||
undici-types@7.16.0:
|
||||
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
|
||||
|
||||
undici@6.21.3:
|
||||
resolution: {integrity: sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==}
|
||||
@@ -2645,7 +2645,7 @@ snapshots:
|
||||
discord.js: 14.22.0
|
||||
node-schedule: 2.1.1
|
||||
|
||||
'@nhcarrigan/eslint-config@5.2.0(@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(playwright@1.54.2)(react@19.1.1)(typescript@5.9.2)(vitest@3.2.4(@types/node@24.3.0))':
|
||||
'@nhcarrigan/eslint-config@5.2.0(@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(playwright@1.54.2)(react@19.1.1)(typescript@5.9.2)(vitest@3.2.4(@types/node@25.2.3))':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-plugin-eslint-comments': 4.4.1(eslint@9.33.0)
|
||||
'@eslint/compat': 1.2.4(eslint@9.33.0)
|
||||
@@ -2654,7 +2654,7 @@ snapshots:
|
||||
'@stylistic/eslint-plugin': 2.12.1(eslint@9.33.0)(typescript@5.9.2)
|
||||
'@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(typescript@5.9.2)
|
||||
'@typescript-eslint/parser': 8.19.0(eslint@9.33.0)(typescript@5.9.2)
|
||||
'@vitest/eslint-plugin': 1.1.24(@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(typescript@5.9.2)(vitest@3.2.4(@types/node@24.3.0))
|
||||
'@vitest/eslint-plugin': 1.1.24(@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(typescript@5.9.2)(vitest@3.2.4(@types/node@25.2.3))
|
||||
eslint: 9.33.0
|
||||
eslint-plugin-deprecation: 3.0.0(eslint@9.33.0)(typescript@5.9.2)
|
||||
eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)
|
||||
@@ -2667,7 +2667,7 @@ snapshots:
|
||||
playwright: 1.54.2
|
||||
react: 19.1.1
|
||||
typescript: 5.9.2
|
||||
vitest: 3.2.4(@types/node@24.3.0)
|
||||
vitest: 3.2.4(@types/node@25.2.3)
|
||||
transitivePeerDependencies:
|
||||
- '@typescript-eslint/utils'
|
||||
- eslint-import-resolver-typescript
|
||||
@@ -2942,17 +2942,17 @@ snapshots:
|
||||
|
||||
'@types/node-schedule@2.1.8':
|
||||
dependencies:
|
||||
'@types/node': 24.3.0
|
||||
'@types/node': 25.2.3
|
||||
|
||||
'@types/node@24.3.0':
|
||||
'@types/node@25.2.3':
|
||||
dependencies:
|
||||
undici-types: 7.10.0
|
||||
undici-types: 7.16.0
|
||||
|
||||
'@types/normalize-package-data@2.4.4': {}
|
||||
|
||||
'@types/ws@8.18.1':
|
||||
dependencies:
|
||||
'@types/node': 24.3.0
|
||||
'@types/node': 25.2.3
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(typescript@5.9.2)':
|
||||
dependencies:
|
||||
@@ -3121,13 +3121,13 @@ snapshots:
|
||||
'@typescript-eslint/types': 8.40.0
|
||||
eslint-visitor-keys: 4.2.1
|
||||
|
||||
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(typescript@5.9.2)(vitest@3.2.4(@types/node@24.3.0))':
|
||||
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(typescript@5.9.2)(vitest@3.2.4(@types/node@25.2.3))':
|
||||
dependencies:
|
||||
'@typescript-eslint/utils': 8.40.0(eslint@9.33.0)(typescript@5.9.2)
|
||||
eslint: 9.33.0
|
||||
optionalDependencies:
|
||||
typescript: 5.9.2
|
||||
vitest: 3.2.4(@types/node@24.3.0)
|
||||
vitest: 3.2.4(@types/node@25.2.3)
|
||||
|
||||
'@vitest/expect@3.2.4':
|
||||
dependencies:
|
||||
@@ -3137,13 +3137,13 @@ snapshots:
|
||||
chai: 5.3.1
|
||||
tinyrainbow: 2.0.0
|
||||
|
||||
'@vitest/mocker@3.2.4(vite@7.1.3(@types/node@24.3.0))':
|
||||
'@vitest/mocker@3.2.4(vite@7.1.3(@types/node@25.2.3))':
|
||||
dependencies:
|
||||
'@vitest/spy': 3.2.4
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.17
|
||||
optionalDependencies:
|
||||
vite: 7.1.3(@types/node@24.3.0)
|
||||
vite: 7.1.3(@types/node@25.2.3)
|
||||
|
||||
'@vitest/pretty-format@3.2.4':
|
||||
dependencies:
|
||||
@@ -4884,7 +4884,7 @@ snapshots:
|
||||
has-symbols: 1.1.0
|
||||
which-boxed-primitive: 1.1.1
|
||||
|
||||
undici-types@7.10.0: {}
|
||||
undici-types@7.16.0: {}
|
||||
|
||||
undici@6.21.3: {}
|
||||
|
||||
@@ -4907,13 +4907,13 @@ snapshots:
|
||||
spdx-correct: 3.2.0
|
||||
spdx-expression-parse: 3.0.1
|
||||
|
||||
vite-node@3.2.4(@types/node@24.3.0):
|
||||
vite-node@3.2.4(@types/node@25.2.3):
|
||||
dependencies:
|
||||
cac: 6.7.14
|
||||
debug: 4.4.1
|
||||
es-module-lexer: 1.7.0
|
||||
pathe: 2.0.3
|
||||
vite: 7.1.3(@types/node@24.3.0)
|
||||
vite: 7.1.3(@types/node@25.2.3)
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- jiti
|
||||
@@ -4928,7 +4928,7 @@ snapshots:
|
||||
- tsx
|
||||
- yaml
|
||||
|
||||
vite@7.1.3(@types/node@24.3.0):
|
||||
vite@7.1.3(@types/node@25.2.3):
|
||||
dependencies:
|
||||
esbuild: 0.25.9
|
||||
fdir: 6.5.0(picomatch@4.0.3)
|
||||
@@ -4937,14 +4937,14 @@ snapshots:
|
||||
rollup: 4.46.3
|
||||
tinyglobby: 0.2.14
|
||||
optionalDependencies:
|
||||
'@types/node': 24.3.0
|
||||
'@types/node': 25.2.3
|
||||
fsevents: 2.3.3
|
||||
|
||||
vitest@3.2.4(@types/node@24.3.0):
|
||||
vitest@3.2.4(@types/node@25.2.3):
|
||||
dependencies:
|
||||
'@types/chai': 5.2.2
|
||||
'@vitest/expect': 3.2.4
|
||||
'@vitest/mocker': 3.2.4(vite@7.1.3(@types/node@24.3.0))
|
||||
'@vitest/mocker': 3.2.4(vite@7.1.3(@types/node@25.2.3))
|
||||
'@vitest/pretty-format': 3.2.4
|
||||
'@vitest/runner': 3.2.4
|
||||
'@vitest/snapshot': 3.2.4
|
||||
@@ -4962,11 +4962,11 @@ snapshots:
|
||||
tinyglobby: 0.2.14
|
||||
tinypool: 1.1.1
|
||||
tinyrainbow: 2.0.0
|
||||
vite: 7.1.3(@types/node@24.3.0)
|
||||
vite-node: 3.2.4(@types/node@24.3.0)
|
||||
vite: 7.1.3(@types/node@25.2.3)
|
||||
vite-node: 3.2.4(@types/node@25.2.3)
|
||||
why-is-node-running: 2.3.0
|
||||
optionalDependencies:
|
||||
'@types/node': 24.3.0
|
||||
'@types/node': 25.2.3
|
||||
transitivePeerDependencies:
|
||||
- jiti
|
||||
- less
|
||||
|
||||
+25
-1
@@ -6,15 +6,26 @@
|
||||
|
||||
export const ids = {
|
||||
channels: {
|
||||
formSubmissions: "1410435042898874471",
|
||||
accessibilityForum: "1451006622838030509",
|
||||
billingQuestions: "1451010972771811480",
|
||||
bugReports: "1447723804330823763",
|
||||
communityFeedback: "1447726591189975210",
|
||||
featureRequests: "1447726510369931295",
|
||||
formSubmissions: "1448445144071147520",
|
||||
gaming: "1385797656307175468",
|
||||
general: "1385797320389431336",
|
||||
legalNotices: "1451009920479793254",
|
||||
marketingProposals: "1451012386327756902",
|
||||
menteeChat: "1400589073613062204",
|
||||
mentorshipGoalForum: "1400629118110011526",
|
||||
mentorshipProjectForum: "1400616702265266186",
|
||||
naomiDiscussionForum: "1408154690121633917",
|
||||
news: "1407804798677418198",
|
||||
partnershipRequests: "1451009066355654829",
|
||||
policyIdeation: "1417294974046965842",
|
||||
pressInquiries: "1451011543482368163",
|
||||
resumeReviewForum: "1407807555266154496",
|
||||
technicalSupport: "1451014823440678972",
|
||||
},
|
||||
guilds: {
|
||||
nhcarrigan: "1354624415861833870",
|
||||
@@ -41,6 +52,19 @@ export const ids = {
|
||||
member: "1407807699718111292",
|
||||
naomi: "1407807752549699727",
|
||||
},
|
||||
unanswered: {
|
||||
accessibilityForum: "1451008476779122869",
|
||||
billingQuestions: "1451011252301205524",
|
||||
bugReports: "1447726213446500555",
|
||||
communityFeedback: "1447726807595094036",
|
||||
featureRequests: "1447726899919978677",
|
||||
legalNotices: "1451010521687130313",
|
||||
marketingProposals: "1451012664858906720",
|
||||
partnershipRequests: "1451009530459586650",
|
||||
policyIdeation: "1447755602318196828",
|
||||
pressInquiries: "1451012067841544223",
|
||||
technicalSupport: "1451015143646298132",
|
||||
},
|
||||
},
|
||||
users: {
|
||||
amari: "1406431359345496255",
|
||||
|
||||
@@ -3,25 +3,47 @@
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import type { ProgressReminder } from "../interfaces/reminder.js";
|
||||
|
||||
interface Channel {
|
||||
channelId: string;
|
||||
roleId: string;
|
||||
name: string;
|
||||
createThread: boolean;
|
||||
}
|
||||
|
||||
const nhcarriganMentorshipChannels: Array<Channel> = [
|
||||
|
||||
const nhcarriganMentorshipChannels: Array<ProgressReminder> = [
|
||||
{
|
||||
channelId: "1400630073010163792",
|
||||
createThread: true,
|
||||
name: "accountability",
|
||||
roleId: "1400588705273745550",
|
||||
},
|
||||
];
|
||||
const freeCodeCampSprintChannels: Array<Channel> = [
|
||||
|
||||
const freeCodeCampSprintChannels: Array<ProgressReminder> = [
|
||||
{
|
||||
channelId: "1424801426160488520",
|
||||
createThread: true,
|
||||
name: "JS Objects/Arrays/Loops",
|
||||
roleId: "1425506225453273224",
|
||||
},
|
||||
{
|
||||
channelId: "1424801426160488520",
|
||||
createThread: true,
|
||||
name: "Python Basics",
|
||||
roleId: "1450187499912695838",
|
||||
},
|
||||
{
|
||||
channelId: "1424801426160488520",
|
||||
createThread: true,
|
||||
name: "Miscellaneous Sprints",
|
||||
roleId: "1450672361291513916",
|
||||
},
|
||||
{
|
||||
channelId: "1442575112384811158",
|
||||
createThread: false,
|
||||
name: "Alpha and Omega",
|
||||
roleId: "1458984977101230196",
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* The channels to post progress reminders in.
|
||||
*/
|
||||
export const progressReminders: Array<Channel> = [
|
||||
export const progressReminders: Array<ProgressReminder> = [
|
||||
...nhcarriganMentorshipChannels,
|
||||
...freeCodeCampSprintChannels,
|
||||
];
|
||||
|
||||
+55
-23
@@ -5,23 +5,23 @@
|
||||
*/
|
||||
|
||||
import { DiscordAnalytics } from "@nhcarrigan/discord-analytics";
|
||||
import { Client,
|
||||
import {
|
||||
Client,
|
||||
GatewayIntentBits,
|
||||
Events,
|
||||
Partials,
|
||||
MessageFlags } from "discord.js";
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import { scheduleJob } from "node-schedule";
|
||||
import { App } from "octokit";
|
||||
import { ids } from "./config/ids.js";
|
||||
import { handleMessageCreate } from "./events/handleMessageCreate.js";
|
||||
import { cacheData } from "./modules/cacheData.js";
|
||||
import { checkRetroAchievements } from "./modules/checkAchievements.js";
|
||||
import { getForumTagId } from "./modules/getForumTagId.js";
|
||||
import { logMenteeJoin } from "./modules/logMenteeJoin.js";
|
||||
import { logMenteeLeave } from "./modules/logMenteeLeave.js";
|
||||
import {
|
||||
postFreeCodeCampNews,
|
||||
postHackerNews,
|
||||
} from "./modules/postNews.js";
|
||||
import { postFreeCodeCampNews, postHackerNews } from "./modules/postNews.js";
|
||||
import { postProgressReminders } from "./modules/postProgressReminders.js";
|
||||
import { processMentorshipRole } from "./modules/processMentorshipRole.js";
|
||||
import { processUserGuildTag } from "./modules/processUserGuildTag.js";
|
||||
@@ -30,8 +30,10 @@ import { instantiateServer } from "./server/serve.js";
|
||||
import { logger } from "./utils/logger.js";
|
||||
import type { Amari } from "./interfaces/amari.js";
|
||||
|
||||
if (process.env.GH_CLIENT_ID === undefined
|
||||
|| process.env.GH_PRIVATE_KEY === undefined) {
|
||||
if (
|
||||
process.env.GH_CLIENT_ID === undefined
|
||||
|| process.env.GH_PRIVATE_KEY === undefined
|
||||
) {
|
||||
throw new Error("Cannot initialise GitHub!");
|
||||
}
|
||||
|
||||
@@ -41,17 +43,22 @@ const githubApp = new App({
|
||||
});
|
||||
const octokit = await githubApp.getInstallationOctokit(83_119_105);
|
||||
const { data } = await octokit.rest.apps.getAuthenticated();
|
||||
await logger.log("debug", `Authenticated to GitHub as ${data?.name ?? "unknown"}`);
|
||||
await logger.log(
|
||||
"debug",
|
||||
`Authenticated to GitHub as ${data?.name ?? "unknown"}`,
|
||||
);
|
||||
|
||||
const amari: Amari = {
|
||||
discord: new Client({ intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.MessageContent,
|
||||
GatewayIntentBits.GuildMembers,
|
||||
GatewayIntentBits.DirectMessages,
|
||||
],
|
||||
partials: [ Partials.Channel ] }),
|
||||
discord: new Client({
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.MessageContent,
|
||||
GatewayIntentBits.GuildMembers,
|
||||
GatewayIntentBits.DirectMessages,
|
||||
],
|
||||
partials: [ Partials.Channel ],
|
||||
}),
|
||||
github: octokit,
|
||||
lastRssItems: {
|
||||
freeCodeCamp: null,
|
||||
@@ -63,8 +70,10 @@ const amari: Amari = {
|
||||
const analytics = new DiscordAnalytics(amari.discord, logger);
|
||||
|
||||
amari.discord.once(Events.ClientReady, () => {
|
||||
void logger.log("debug",
|
||||
`Authenticated to Discord as ${amari.discord.user?.username ?? "unknown"}`);
|
||||
void logger.log(
|
||||
"debug",
|
||||
`Authenticated to Discord as ${amari.discord.user?.username ?? "unknown"}`,
|
||||
);
|
||||
void cacheData(amari);
|
||||
analytics.startCron();
|
||||
scheduleJob("post news", "0 * * * *", async() => {
|
||||
@@ -98,10 +107,10 @@ amari.discord.on(Events.InteractionCreate, (interaction) => {
|
||||
void analytics.logGatewayEvent(Events.InteractionCreate, { ...interaction });
|
||||
if (interaction.isButton() && interaction.customId === "resolve") {
|
||||
if (interaction.user.id !== ids.users.naomi) {
|
||||
return void interaction.reply(
|
||||
{ content: "Who are you????",
|
||||
flags: [ MessageFlags.Ephemeral ] },
|
||||
);
|
||||
return void interaction.reply({
|
||||
content: "Who are you????",
|
||||
flags: [ MessageFlags.Ephemeral ],
|
||||
});
|
||||
}
|
||||
return void interaction.message.delete();
|
||||
}
|
||||
@@ -114,6 +123,29 @@ amari.discord.on(Events.InteractionCreate, (interaction) => {
|
||||
});
|
||||
});
|
||||
|
||||
amari.discord.on(Events.ThreadCreate, (thread) => {
|
||||
if (thread.parent?.isThreadOnly() !== true) {
|
||||
return;
|
||||
}
|
||||
const { bugReports, communityFeedback, featureRequests, policyIdeation }
|
||||
= ids.channels;
|
||||
if (
|
||||
![ bugReports,
|
||||
communityFeedback,
|
||||
featureRequests,
|
||||
policyIdeation ].includes(
|
||||
thread.parent.id,
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const tagId = getForumTagId(thread.parent.id);
|
||||
if (tagId === null) {
|
||||
return;
|
||||
}
|
||||
void thread.setAppliedTags([ tagId ]);
|
||||
});
|
||||
|
||||
amari.discord.on(Events.UserUpdate, (_oldUser, updatedUser) => {
|
||||
void processUserGuildTag(amari, updatedUser);
|
||||
});
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention -- Baserow uses snake case */
|
||||
|
||||
export interface FormSubmission {
|
||||
table_id: number;
|
||||
items: Array<{ id: number }>;
|
||||
[key: string]: unknown;
|
||||
id: number;
|
||||
manualSort: number;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @copyright nhcarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
export interface ProgressReminder {
|
||||
channelId: string;
|
||||
roleId: string;
|
||||
name: string;
|
||||
createThread: boolean;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @copyright NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { ids } from "../config/ids.js";
|
||||
|
||||
/**
|
||||
* Grabs the "unanswered" tag ID for a given forum channel ID.
|
||||
* @param id - The ID of the forum channel.
|
||||
* @returns The ID of the "unanswered" tag, or null if not found.
|
||||
*/
|
||||
// eslint-disable-next-line complexity -- This is less complex than trying to narrow the type...
|
||||
export const getForumTagId = (id: string): string | null => {
|
||||
switch (id) {
|
||||
case ids.channels.bugReports:
|
||||
return ids.tags.unanswered.bugReports;
|
||||
case ids.channels.communityFeedback:
|
||||
return ids.tags.unanswered.communityFeedback;
|
||||
case ids.channels.featureRequests:
|
||||
return ids.tags.unanswered.featureRequests;
|
||||
case ids.channels.policyIdeation:
|
||||
return ids.tags.unanswered.policyIdeation;
|
||||
case ids.channels.accessibilityForum:
|
||||
return ids.tags.unanswered.accessibilityForum;
|
||||
case ids.channels.marketingProposals:
|
||||
return ids.tags.unanswered.marketingProposals;
|
||||
case ids.channels.technicalSupport:
|
||||
return ids.tags.unanswered.technicalSupport;
|
||||
case ids.channels.billingQuestions:
|
||||
return ids.tags.unanswered.billingQuestions;
|
||||
case ids.channels.pressInquiries:
|
||||
return ids.tags.unanswered.pressInquiries;
|
||||
case ids.channels.partnershipRequests:
|
||||
return ids.tags.unanswered.partnershipRequests;
|
||||
case ids.channels.legalNotices:
|
||||
return ids.tags.unanswered.legalNotices;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -40,13 +40,5 @@ export const logMenteeJoin = async(
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
await channel.send({
|
||||
content: `Hey <@${member.id}>~!
|
||||
|
||||
Welcome to our community! It looks like you may have applied for our mentorship programme!
|
||||
|
||||
If that is correct, you should ping Naomi to grant your role and begin onboarding! <a:love:1364089736557494353>`,
|
||||
});
|
||||
await logger.metric("processed_mentee_join", 1, { user: member.id });
|
||||
};
|
||||
|
||||
@@ -123,6 +123,13 @@ const postHackerNews = async(amari: Amari): Promise<void> => {
|
||||
}
|
||||
await Promise.all(
|
||||
latestPosts.map(async(post) => {
|
||||
if (
|
||||
hasNaughtyWords(post.title)
|
||||
|| hasNaughtyWords(post.contentSnippet)
|
||||
|| hasNaughtyWords(post.content)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const sent = await channel.send(post.link);
|
||||
if (channel.type === ChannelType.GuildAnnouncement) {
|
||||
await sent.crosspost();
|
||||
|
||||
@@ -3,70 +3,79 @@
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import { ChannelType } from "discord.js";
|
||||
import { ChannelType, type TextChannel } from "discord.js";
|
||||
import { progressReminders } from "../config/progressReminders.js";
|
||||
import { logger } from "../utils/logger.js";
|
||||
import type { Amari } from "../interfaces/amari.js";
|
||||
import type { ProgressReminder } from "../interfaces/reminder.js";
|
||||
|
||||
/**
|
||||
* Posts a daily progress check-in reminder in configured channels.
|
||||
* @param amari - Amari's instance.
|
||||
*/
|
||||
// eslint-disable-next-line max-lines-per-function -- shut up
|
||||
export const postProgressReminders = async(
|
||||
amari: Amari,
|
||||
): Promise<void> => {
|
||||
export const postProgressReminders = async(amari: Amari): Promise<void> => {
|
||||
try {
|
||||
const mapped = await Promise.all(
|
||||
progressReminders.map(async(channel) => {
|
||||
progressReminders.map(async(reminder) => {
|
||||
const fetched = await amari.discord.channels.
|
||||
fetch(channel.channelId).
|
||||
fetch(reminder.channelId).
|
||||
catch(() => {
|
||||
void logger.log("warn", `Failed to fetch channel ${channel.name}.`);
|
||||
void logger.log(
|
||||
"warn",
|
||||
`Failed to fetch channel ${reminder.name}.`,
|
||||
);
|
||||
return null;
|
||||
});
|
||||
if (!fetched) {
|
||||
await logger.log("warn", `Channel ${channel.name} not found.`);
|
||||
return null;
|
||||
await logger.log("warn", `Channel ${reminder.name} not found.`);
|
||||
return { channel: null, reminder: reminder };
|
||||
}
|
||||
if (fetched.type !== ChannelType.GuildText) {
|
||||
await logger.log(
|
||||
"warn",
|
||||
`Channel ${channel.name} is not a text channel.`,
|
||||
`Channel ${reminder.name} is not a text channel.`,
|
||||
);
|
||||
return null;
|
||||
return { channel: null, reminder: reminder };
|
||||
}
|
||||
return fetched;
|
||||
return { channel: fetched, reminder: reminder };
|
||||
}),
|
||||
);
|
||||
const filtered = mapped.filter((channel) => {
|
||||
const filtered: Array<{
|
||||
channel: TextChannel;
|
||||
reminder: ProgressReminder;
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Filter is dumb.
|
||||
}> = mapped.filter(({ channel }) => {
|
||||
return channel !== null;
|
||||
});
|
||||
}) as Array<{
|
||||
channel: TextChannel;
|
||||
reminder: ProgressReminder;
|
||||
}>;
|
||||
await Promise.all(
|
||||
filtered.map(async(channel) => {
|
||||
const isThread = progressReminders.find((c) => {
|
||||
return c.channelId === channel.id;
|
||||
})?.createThread ?? false;
|
||||
const sent = await channel.
|
||||
send({ allowedMentions: {
|
||||
parse: [ "roles" ],
|
||||
},
|
||||
content:
|
||||
`Good morning <@&${
|
||||
progressReminders.find((c) => {
|
||||
return c.channelId === channel.id;
|
||||
})?.roleId ?? channel.guildId
|
||||
}> It is time for your daily progress update. Please share the following in ${isThread
|
||||
? "the thread attached to this message"
|
||||
: "this channel"}:
|
||||
filtered.map(async(reminder) => {
|
||||
const isThread
|
||||
= progressReminders.find((c) => {
|
||||
return c.channelId === reminder.channel.id;
|
||||
})?.createThread ?? false;
|
||||
const sent = await reminder.channel.
|
||||
send({
|
||||
allowedMentions: {
|
||||
parse: [ "roles" ],
|
||||
},
|
||||
content: `Good morning <@&${reminder.reminder.roleId}> It is time for your daily progress update. Please share the following in ${
|
||||
isThread
|
||||
? "the thread attached to this message"
|
||||
: "this channel"
|
||||
}:
|
||||
|
||||
1️⃣ What did you accomplish yesterday?
|
||||
2️⃣ What are you working on today?
|
||||
3️⃣ Are there any blockers or issues you need help with?` }).
|
||||
3️⃣ Are there any blockers or issues you need help with?`,
|
||||
}).
|
||||
catch(() => {
|
||||
void logger.log(
|
||||
"warn",
|
||||
`Failed to send progress reminder in channel ${channel.name}.`,
|
||||
`Failed to send progress reminder in channel ${reminder.channel.name}.`,
|
||||
);
|
||||
return null;
|
||||
});
|
||||
@@ -79,7 +88,7 @@ export const postProgressReminders = async(
|
||||
catch(() => {
|
||||
void logger.log(
|
||||
"warn",
|
||||
`Failed to start thread in channel ${channel.name}.`,
|
||||
`Failed to start thread in channel ${reminder.channel.name}.`,
|
||||
);
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
*/
|
||||
|
||||
import { MessageFlags } from "discord.js";
|
||||
import { formIds } from "../config/forms.js";
|
||||
import { ids } from "../config/ids.js";
|
||||
import { logger } from "../utils/logger.js";
|
||||
import type { Amari } from "../interfaces/amari.js";
|
||||
@@ -21,18 +20,26 @@ import type { FastifyRequest, FastifyReply } from "fastify";
|
||||
// eslint-disable-next-line max-lines-per-function -- only long because of analytics.
|
||||
export const processFormSubmission = async(
|
||||
amari: Amari,
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
request: FastifyRequest<{ Body: FormSubmission }>,
|
||||
request: FastifyRequest<{
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
Body: Array<FormSubmission>;
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
Querystring: { form?: string };
|
||||
}>,
|
||||
response: FastifyReply,
|
||||
): Promise<void> => {
|
||||
const { secret } = request.headers;
|
||||
if (secret !== process.env.BASEROW_SECRET
|
||||
|| process.env.BASEROW_SECRET === undefined) {
|
||||
const { authorization: secret } = request.headers;
|
||||
if (
|
||||
secret !== process.env.BASEROW_SECRET
|
||||
|| secret === undefined
|
||||
) {
|
||||
await response.status(403).send({ message: "Invalid Secret Provided." });
|
||||
return;
|
||||
}
|
||||
const { form } = request.query;
|
||||
await response.status(204).send();
|
||||
const channel = amari.discord.channels.cache.get(ids.channels.formSubmissions)
|
||||
const channel
|
||||
= amari.discord.channels.cache.get(ids.channels.formSubmissions)
|
||||
?? await amari.discord.channels.fetch(ids.channels.formSubmissions);
|
||||
if (channel?.isSendable() !== true) {
|
||||
await logger.log(
|
||||
@@ -41,16 +48,16 @@ export const processFormSubmission = async(
|
||||
);
|
||||
return;
|
||||
}
|
||||
const { table_id: table, items } = request.body;
|
||||
const rowIds = items.map((item) => {
|
||||
return item.id;
|
||||
}).join(", ");
|
||||
const tableName = formIds[table];
|
||||
const submissionIds = request.body.map((item) => {
|
||||
return `${item.id.toString()} (${item.manualSort.toString()})`;
|
||||
});
|
||||
await channel.send({
|
||||
components: [
|
||||
{
|
||||
content: `${tableName ?? "Unknown Form"} Submission Received!\n\nRow ID(s): ${rowIds}`,
|
||||
type: 10,
|
||||
content: `${
|
||||
form ?? "Unknown Form"
|
||||
} Submission Received!\n\nRow ID(s): ${submissionIds.join(", ")}`,
|
||||
type: 10,
|
||||
},
|
||||
{
|
||||
components: [
|
||||
@@ -68,5 +75,7 @@ export const processFormSubmission = async(
|
||||
],
|
||||
flags: [ MessageFlags.IsComponentsV2 ],
|
||||
});
|
||||
await logger.metric("processed_form_submission", 1, { table: String(table) });
|
||||
await logger.metric("processed_form_submission", 1, {
|
||||
table: String(request.body),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -46,11 +46,11 @@ export const processMentorshipRole = async(
|
||||
|
||||
Welcome to our mentorship programme! We are excited to have you here and help you grow and reach success.
|
||||
|
||||
To get started, please make sure you have accepted the GitHub invite for your dedicated repository under the [NHCarrigan Mentorship organsation](<https://github.com/nhcarrigan-mentorship>).
|
||||
To get started, please ping Naomi with your GitHub username and your first and last name. She will invite you to your dedicated repository in the [NHCarrigan Mentorship organsation](<https://github.com/nhcarrigan-mentorship>) where you can work on your flagship project.
|
||||
|
||||
Once you have done this, your next step is to read our [wiki](<https://nhcarrigan.notion.site/mentorship-wiki>). Then, create your post in <#1400629118110011526> as outlined in the wiki.
|
||||
Once you have done this, your next step is to read our [wiki](<https://docs.nhcarrigan.com/mentorship/00-faq/>). Then, create your goal-setting post in <#1400629118110011526> and your project-planning post in <#1400616702265266186> as outlined in the wiki.
|
||||
|
||||
Naomi will follow up with you from there! Best of luck on your journey~! <a:love:1364089736557494353>`,
|
||||
If at any time you need some guidance, support, or review, please ping Naomi! She's always happy to help you succeed in your mentorship! Best of luck on your journey~! <a:love:1364089736557494353>`,
|
||||
});
|
||||
await logger.metric("processed_mentorship_role", 1, {
|
||||
user: updatedMember.id,
|
||||
|
||||
+13
-10
@@ -70,7 +70,7 @@ export const instantiateServer = (amari: Amari): void => {
|
||||
});
|
||||
|
||||
server.post<{
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
Body: GithubPayload;
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
Querystring: { secret: string };
|
||||
@@ -87,16 +87,19 @@ export const instantiateServer = (amari: Amari): void => {
|
||||
|
||||
server.
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
post<{ Body: FormSubmission }>("/form", async(request, response) => {
|
||||
try {
|
||||
await processFormSubmission(amari, request, response);
|
||||
} catch (error) {
|
||||
if (!(error instanceof Error)) {
|
||||
return;
|
||||
post<{ Body: Array<FormSubmission>; Querystring: { form: string } }>(
|
||||
"/form",
|
||||
async(request, response) => {
|
||||
try {
|
||||
await processFormSubmission(amari, request, response);
|
||||
} catch (error) {
|
||||
if (!(error instanceof Error)) {
|
||||
return;
|
||||
}
|
||||
await logger.error("/form route", error);
|
||||
}
|
||||
await logger.error("/form route", error);
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
server.listen({ port: 7044 }, (error) => {
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user