Thanks for contributing to TeachLink.
- Do not push directly to protected branches (
main,develop). - Create a feature branch from
develop(preferred) ormain:feat/<short-description>fix/<short-description>chore/<short-description>
Before opening a PR, ensure the issue is assigned to you.
Your PR will be blocked from merging unless it meets the following:
-
CI must pass
- Required checks:
type-check,lint,build,test,security-audit(GitHub Actions: Branch Protection)
- Required checks:
-
Approvals required
- Minimum 1–2 approvals (as configured in branch protection rules).
-
Branch must be up to date
- Update your branch with the target branch before merge (no stale merge).
-
Conversations resolved
- All review conversations must be resolved before merge.
-
Issue must be referenced
- PR description must reference a GitHub issue and include one of:
Close #<issue-number>/Closes #<issue-number>/Fixes #<issue-number>
- PR description must reference a GitHub issue and include one of:
pnpm run type-checkpnpm run lintpnpm run testpnpm run buildpnpm audit --audit-level=high
Before a push is sent to the remote, the pre-push hook runs automatically:
- Git LFS — validates LFS-tracked files (
git lfs pre-push) - Type-check —
pnpm run type-check(tsc --noEmit) - Tests —
pnpm run test(vitest run)
If type-check or tests fail, the push is blocked and the hook prints which check failed. Fix the reported errors and push again.
The hook ensures pnpm is on PATH (common install locations and $PNPM_HOME). If pnpm still cannot be found, the push is blocked with a clear message.
lint and build are not run by this hook; run them locally or rely on CI before opening a PR.
Use the PR template (auto-applied). Ensure it includes:
- Summary of changes
- Testing notes
Close #<issue-number>
- Keep changes small and focused.
- No console errors.
- Use
lucide-reacticons for UI. - Keep components accessible and responsive.
Do not commit secrets. Use .env.local for local environment variables.
CI runs a security-audit job on every pull request to main and develop. It executes:
pnpm audit --audit-level=highPolicy:
- High and critical severity vulnerabilities fail the pipeline and block merge.
- Low and moderate findings are reported but do not block merge.
- The full JSON audit report is uploaded as a CI artifact (
dependency-audit-report) on every run.
Run the same check locally before pushing:
pnpm audit --audit-level=highIf a high or critical CVE cannot be fixed immediately (no patch available, breaking upgrade, or false positive), you may suppress it after maintainer review:
- Confirm the risk is understood and document the rationale in the PR.
- Add the CVE or GHSA identifier to
pnpm.auditConfiginpackage.json:
"pnpm": {
"auditConfig": {
"ignoreCves": ["CVE-YYYY-NNNNN"],
"ignoreGhsas": ["GHSA-xxxx-xxxx-xxxx"]
}
}- Open a follow-up issue to remove the suppression when a fix is available.
Suppressions require explicit PR approval — do not add ignored CVEs without maintainer sign-off.
Dependabot (.github/dependabot.yml) opens weekly PRs for npm dependency updates. Review and merge these promptly to keep the dependency tree current.