Files
blog/.pre-commit-config.yaml
squid d506254955
All checks were successful
Frontend CI / build (push) Successful in 1m20s
Auto Comment On PR / add_improve_comment (pull_request) Successful in 13s
PR Title Check / pr-title-check (pull_request) Successful in 16s
BLOG-261 Fix Supply Sentry auth token to frontend build to enable log and sourcemap uploads (#265)
### Description

#### Summary

This resolves the issue where Sentry logs and source maps were failing to upload during the deployment pipeline (BLOG-261). The core problem was that the frontend build environment lacked the necessary authentication credentials to communicate with the Sentry API. I've updated the deployment workflow to pass the `SENTRY_AUTH_TOKEN` from our CI secrets into the Docker build context, and updated the frontend Dockerfile to securely mount and utilize this token during the build phase. A minor descriptive adjustment was also made to our pre-commit config.

#### Key Changes

* **`.gitea/workflows/deployment.yaml`**: Injected the `SENTRY_AUTH_TOKEN` into the build container's secrets configuration.
* **`frontend/Dockerfile`**: Configured secure secret mounting (`--mount=type=secret`) to read `SENTRY_AUTH_TOKEN` and expose it as an environment variable specifically during the `pnpm run build` execution.
* **`.pre-commit-config.yaml`**: Renamed the `frontend-lint` hook from "frontend lint" to "frontend lint & check" to better reflect its underlying script behavior.

#### Testing/Review Notes
* Trigger a deployment build in the CI/CD pipeline to test the workflow changes.
* Check the build logs for the frontend container; verify that the Sentry plugin successfully detects the token and uploads the sourcemaps/releases without throwing an authentication error.
* Ensure no token leakage occurs in the standard CI output logs or the final compiled Docker image layers.

### Package Changes

_No response_

### Screenshots

_No response_

### Reference

Resolves #261.

### Checklist

- [x] A milestone is set
- [x] The related issuse has been linked to this branch

Reviewed-on: #265
Co-authored-by: squid <squid@squidspirit.com>
Co-committed-by: squid <squid@squidspirit.com>
2026-04-04 17:11:02 +08:00

22 lines
598 B
YAML

repos:
- repo: local
hooks:
- id: sqlx-prepare
name: sqlx prepare
language: script
entry: ./script/pre-commit/sqlx-prepare.sh
pass_filenames: false
files: ^backend/
- id: backend-check
name: backend check
language: script
entry: ./script/pre-commit/backend-check.sh
pass_filenames: false
files: ^backend/
- id: frontend-lint
name: frontend lint & check
language: script
entry: ./script/pre-commit/frontend-lint.sh
pass_filenames: false
files: ^frontend/