Skip to content

Commit 45ea92a

Browse files
authored
feat: add security scanning, PR template, pre-commit hooks, and AGENTS.md (#1)
* feat: add security scanning, PR template, pre-commit hooks, and AGENTS.md - Add CodeQL security scanning workflow with weekly schedule - Add dependency review for pull requests - Create comprehensive PR template with testing checklist - Install Husky and lint-staged for pre-commit hooks - Add AGENTS.md with AI agent guidelines and coding standards * fix: make dependency review non-blocking until Dependency graph is enabled Add continue-on-error: true to prevent PR blocking when Dependency graph is not enabled in repository settings. Added comment explaining the required setup for full functionality.
1 parent 69c53c7 commit 45ea92a

6 files changed

Lines changed: 571 additions & 3 deletions

File tree

.github/pull_request_template.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Summary
2+
<!-- Brief description of changes -->
3+
4+
## Type of Change
5+
- [ ] Bug fix (non-breaking change that fixes an issue)
6+
- [ ] New feature (non-breaking change that adds functionality)
7+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
8+
- [ ] Documentation update
9+
- [ ] Refactoring (no functional changes)
10+
- [ ] Performance improvement
11+
- [ ] Test coverage improvement
12+
13+
## Related Issues
14+
<!-- Link to related issues: Fixes #123, Closes #456 -->
15+
16+
## Testing
17+
- [ ] Unit tests added/updated
18+
- [ ] Integration tests added/updated
19+
- [ ] Storybook stories added/updated (for UI changes)
20+
- [ ] Manual testing completed
21+
- [ ] E2E tests added/updated (for critical user flows)
22+
23+
## Checklist
24+
- [ ] Code follows project style guidelines (ESLint, Prettier)
25+
- [ ] Self-review completed
26+
- [ ] Documentation updated (if applicable)
27+
- [ ] No new TypeScript errors (`npx nx typecheck <package>`)
28+
- [ ] All existing tests pass (`npx nx test <package>`)
29+
- [ ] GraphQL schema changes are backward compatible (if applicable)
30+
- [ ] Database migrations are properly structured (if applicable)
31+
32+
## Screenshots/Videos
33+
<!-- If applicable, add screenshots or videos to demonstrate the changes -->
34+
35+
## Additional Notes
36+
<!-- Any additional context or notes for reviewers -->

.github/workflows/security.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Security Scan
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
schedule:
8+
- cron: '0 0 * * 0'
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
16+
17+
jobs:
18+
codeql:
19+
name: CodeQL Analysis
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 30
22+
permissions:
23+
security-events: write
24+
contents: read
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v3
33+
with:
34+
languages: javascript-typescript
35+
36+
- name: Perform CodeQL Analysis
37+
uses: github/codeql-action/analyze@v3
38+
with:
39+
category: "/language:javascript-typescript"
40+
41+
# NOTE: Dependency Review requires the Dependency graph to be enabled in the repository settings.
42+
# To enable: Repository Settings > Security > Code security > Dependency graph (Enable)
43+
# Without this setting, the job will fail but won't block the PR due to continue-on-error.
44+
dependency-review:
45+
name: Dependency Review
46+
runs-on: ubuntu-latest
47+
if: github.event_name == 'pull_request'
48+
timeout-minutes: 10
49+
continue-on-error: true
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
54+
- name: Dependency Review
55+
uses: actions/dependency-review-action@v4
56+
with:
57+
fail-on-severity: high

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

0 commit comments

Comments
 (0)