Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
be4fa85
Add configuration files and update dependencies
csikb Sep 26, 2025
0b74aaa
Update dependencies for koa, axios, graphql-request, and others
csikb Sep 26, 2025
ec78d98
Update dependencies for koa, axios, graphql-request, and others
csikb Sep 26, 2025
bd72dc9
Update dependencies for koa, axios, graphql-request, and others
csikb Sep 26, 2025
9867158
Update TypeScript configuration to extend strictest and node22 settings
csikb Sep 26, 2025
42ac659
Refactor environment variable access and update Dockerfile to use pnp…
csikb Sep 26, 2025
d8986e3
Replace koa-router with @koa/router and add docker-bake.hcl for build…
csikb Sep 27, 2025
6d48ecb
Update health.ts to use single quotes for import statement
csikb Sep 27, 2025
8d3e14a
Fix helmet import and update type imports in config.ts; adjust lint s…
csikb Sep 27, 2025
f0186ca
Update imports for consistency and enhance build permissions in confi…
csikb Sep 27, 2025
3c858fe
Fix helmet import in tests to access default export correctly
csikb Sep 27, 2025
e95aaf4
Fix helmet import in tests to access default export correctly
csikb Sep 27, 2025
22f2609
Fix helmet import in tests to access default export correctly
csikb Sep 27, 2025
ebcb86e
Refactor config.yml by removing unused defaults and GitHub release steps
csikb Sep 27, 2025
ad0e5ce
Update config.ts to use bracket notation for environment variables
csikb Sep 27, 2025
64ce8b9
Update config.ts to use bracket notation for environment variables
csikb Sep 27, 2025
a678918
Refactor global setup to use project context and remove global variable
csikb Sep 27, 2025
793aa56
Update package.json to rename semantic-release script and specify Nod…
csikb Sep 27, 2025
1193765
Update Dockerfile to use specific image digest for node:22-alpine
csikb Sep 27, 2025
7c8f11a
Update Dockerfile to use specific image digest for node:22-alpine
csikb Sep 27, 2025
dd42418
Update Dockerfile to use specific image digest for node:22-alpine
csikb Sep 27, 2025
b38a76b
Update Dockerfile to use specific image digest for node:22-alpine
csikb Sep 27, 2025
ea61c98
Refactor CI workflows to remove redundant build step and rename cover…
csikb Sep 27, 2025
62f2c32
Refactor global setup and renovate configuration for improved readabi…
csikb Sep 27, 2025
f7b6121
Update CI test command to include coverage reporting
csikb Sep 27, 2025
792813e
Add permissions for id-token and enable OIDC usage in CI test workflow
csikb Sep 27, 2025
6ce1169
Update docker-compose.yml to configure OAuth2 resource server settings
csikb Sep 27, 2025
5705d02
Update docker-compose.yml to configure OAuth2 resource server settings
csikb Sep 27, 2025
9f54061
Update docker-compose.yml to configure OAuth2 resource server settings
csikb Sep 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @csikb
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build
Comment thread Fixed

on:
workflow_dispatch:
pull_request:
merge_group:
push:
branches: [ "main" ]

jobs:
coverage:
name: Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: package.json
cache: 'pnpm'
- run: pnpm install
- run: pnpm run test:coverage

integration:
name: Integration test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: package.json
cache: 'pnpm'
- run: pnpm install
- run: pnpm run test:coverage
env:
DEBUG: testcontainers:compose

test:
name: Unit test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: package.json
cache: 'pnpm'
- run: pnpm install
- run: pnpm run test:ci

lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: package.json
cache: 'pnpm'
- run: pnpm install
- run: pnpm run lint
85 changes: 85 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Docker

on:
pull_request:
workflow_dispatch:
merge_group:
schedule:
- cron: "0 0 * * *"
push:
branches: [ "main" ]
release:
types: [ published ]

permissions: read-all

jobs:
lint:
name: Lint Dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: hadolint/hadolint-action@3fc49fb50d59c6ab7917a2e4195dba633e515b29 # v3.2.0

build:
name: Build and publish
runs-on: ubuntu-24.04-arm
permissions:
Comment on lines +24 to +27
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Use an available runner label

ubuntu-24.04-arm isn’t currently a GitHub-hosted runner label, so the job will fail to even queue. Switch to the supported ubuntu-22.04-arm64 (or ubuntu-latest) so the build can run.

-    runs-on: ubuntu-24.04-arm
+    runs-on: ubuntu-22.04-arm64
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
build:
name: Build and publish
runs-on: ubuntu-24.04-arm
permissions:
build:
name: Build and publish
runs-on: ubuntu-22.04-arm64
permissions:
🤖 Prompt for AI Agents
.github/workflows/docker.yml around lines 24 to 27: the job uses a non-existent
runner label `ubuntu-24.04-arm` so the workflow will never queue; change the
`runs-on` value to a supported runner such as `ubuntu-22.04-arm64` (or
`ubuntu-latest`) to allow the job to run, and update any other workflow jobs or
matrix entries that reference the invalid label to the same supported label for
consistency.

contents: read
packages: write
Comment thread Fixed
attestations: write
id-token: write
security-events: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
id: meta
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=schedule
type=semver,pattern={{raw}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=ref,event=branch
type=ref,event=pr
# on.schedule: nightly
# on.push:tag: latest (auto), v1.2.3, v.1,2, v.1
# on.push.branch: branchName
# on.pull_request: pr-number (won't be pushed)

- uses: docker/bake-action@3acf805d94d93a86cce4ca44798a76464a75b88c # v6.9.0
with:
push: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
files: |
cwd://${{ steps.meta.outputs.bake-file }}
cwd://${{ steps.meta.outputs.bake-file-annotations }}
./docker-bake.hcl
sbom: true
provenance: true
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max

- uses: anchore/scan-action@f6601287cdb1efc985d6b765bbf99cb4c0ac29d8 # v7.0.0
id: scan
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
with:
image: "ghcr.io/bsstudio/bss-web-graphql:${{ env.DOCKER_METADATA_OUTPUT_VERSION }}"
cache-db: true
severity-cutoff: 'high'
fail-build: false

- uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
pull_request:
merge_group:
push:
branches: [ main ]
Comment on lines +3 to +7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Restrict the release workflow to push-only triggers.

This job depends on vars.RELEASE_APP_ID and secrets.RELEASE_APP_PRIVATE_KEY. On pull_request runs (especially from forks), those values are unavailable, so the job will fail before steps run—effectively blocking outside contributions. Release automation should fire only after code lands on the release branch. Please drop the PR/merge_group triggers (or gate the job with if: github.event_name == 'push') so we only run on trusted pushes to main.

-on:
-  pull_request:
-  merge_group:
-  push:
-    branches: [ main ]
+on:
+  push:
+    branches: [ main ]
+  workflow_dispatch:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
on:
pull_request:
merge_group:
push:
branches: [ main ]
on:
push:
branches: [ main ]
workflow_dispatch:
🤖 Prompt for AI Agents
In .github/workflows/release.yml around lines 3 to 7 the workflow is triggered
on pull_request and merge_group as well as push, which causes runs from forks to
attempt to access vars.RELEASE_APP_ID and secrets.RELEASE_APP_PRIVATE_KEY and
fail; fix by removing the pull_request and merge_group triggers so the workflow
only triggers on push to main, or alternatively keep triggers but add a
top-level job-level guard (if: github.event_name == 'push') so the release job
only executes on push events where the secrets are available.


permissions: read-all

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
id: release-token
with:
app-id: ${{ vars.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
permission-contents: write # to be able to publish a GitHub release
permission-issues: write # to be able to comment on released issues
permission-pull-requests: write # to be able to comment on released pull requests

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ steps.release-token.outputs.token }}
fetch-depth: 0
# persist-credentials: 'false'

- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: package.json
cache: 'pnpm'

- run: pnpm install

- run: pnpm run release
env:
GH_TOKEN: ${{ steps.release-token.outputs.token }}
80 changes: 80 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '41 19 * * 0'
pull_request:
merge_group:
push:
branches: [ "main" ]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read

steps:
- name: "Checkout code"
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true

# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
# file_mode: git

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
with:
sarif_file: results.sarif
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/jod
8 changes: 8 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://www.schemastore.org/semantic-release.json",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
}
34 changes: 26 additions & 8 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"organizeImports": {
"enabled": true
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
"enabled": true,
"rules": {
"recommended": true
"recommended": true,
"style": {
"noParameterAssign": "error",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error"
}
}
},
"formatter": {
"indentWidth": 2,
"indentStyle": "space"
},
"javascript": {
"formatter": {
"quoteStyle": "single",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
# once db is initialized, we can shut down the container
# however it makes it easy to add data to the db
backend:
image: ghcr.io/bsstudio/bss-web-admin-backend:v1.8.2
image: ghcr.io/bsstudio/bss-web-admin-backend:v2.3.11
healthcheck:
test: "wget --tries=1 --no-verbose -qO- http://localhost:8080/actuator/health | grep -q UP"
start_period: 5s
Expand Down
Loading
Loading