Skip to content

Commit 68d1664

Browse files
authored
Updated configuration (#4)
* Refactor npm configuration and add issue/bug report templates * Add tests for UserController and update Dependabot configuration * Add CodeQL workflow for automated code analysis * Update CodeQL workflow to trigger only on pull requests * Update workflows to trigger on push to develop and main, add test workflow, and enhance release process * Update Dependabot configuration to change commit message prefix for dependency updates * Update Dependabot configuration to set target branch to develop * feat: Update workflows to trigger on pull requests and add CodeQL configuration * feat: Add security-events permission to CodeQL workflow * chore: Remove pull request triggers from CodeQL and test workflows * chore: Upgrade CodeQL action versions to v3 in workflow configuration * feat: Rename jobs in workflows for clarity and consistency * feat: Update CodeQL configuration and add caching for improved performance
1 parent 9e00cf1 commit 68d1664

File tree

5 files changed

+72
-7
lines changed

5 files changed

+72
-7
lines changed

.github/codeql-config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: "Custom CodeQL Config"
2+
3+
paths:
4+
- "src/"
5+
6+
queries:
7+
- uses: security-extended
8+
- uses: security-and-quality

.github/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ updates:
77
time: "10:00"
88
timezone: "Asia/Dhaka"
99
open-pull-requests-limit: 5
10+
target-branch: "develop"
1011
versioning-strategy: increase
1112
commit-message:
12-
prefix: "chore(deps)"
13+
prefix: "deps"

.github/workflows/codeql.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
name: CodeQL
2-
on: [pull_request]
2+
3+
on:
4+
push:
5+
branches: ["develop", "main"]
36

47
jobs:
58
analyze:
69
name: Analyze
710
runs-on: ubuntu-latest
11+
permissions:
12+
security-events: write
813
steps:
914
- name: Checkout repository
1015
uses: actions/checkout@v3
1116

17+
- name: Cache CodeQL Database
18+
uses: actions/cache@v3
19+
with:
20+
path: ~/codeql-db # Store the CodeQL database
21+
key: codeql-db-${{ runner.os }}-${{ github.sha }}
22+
restore-keys: |
23+
codeql-db-${{ runner.os }}-
24+
1225
- name: Initialize CodeQL
13-
uses: github/codeql-action/init@v2
26+
uses: github/codeql-action/init@v3
1427
with:
1528
languages: typescript
29+
config-file: .github/codeql-config.yml
1630

1731
- name: Perform CodeQL Analysis
18-
uses: github/codeql-action/analyze@v2
32+
uses: github/codeql-action/analyze@v3

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
jobs:
99
build:
10+
name: Build
1011
runs-on: ubuntu-latest
1112
steps:
1213
- name: Checkout repository
@@ -28,14 +29,17 @@ jobs:
2829
- name: Install dependencies
2930
run: pnpm install
3031

31-
# - name: Run tests (optional)
32-
# run: pnpm test
32+
- name: Run lint
33+
run: pnpm lint
34+
35+
- name: Run tests
36+
run: pnpm test
3337

3438
- name: Build package
3539
run: pnpm build
3640

3741
- name: Authenticate npm
38-
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
42+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ${{ github.workspace }}/.npmrc
3943

4044
- name: Publish to npm
4145
run: pnpm publish --access public

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test Lint and Build
2+
3+
on:
4+
push:
5+
branches: ["develop", "main"]
6+
7+
jobs:
8+
test:
9+
name: Test
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v4
17+
with:
18+
version: latest
19+
run_install: false
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
registry-url: "https://registry.npmjs.org"
26+
cache: "pnpm"
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Run lint
32+
run: pnpm lint
33+
34+
- name: Run tests
35+
run: pnpm test
36+
37+
- name: Build package
38+
run: pnpm build

0 commit comments

Comments
 (0)