Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 12 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,34 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v1
with:
node-version: 22
cache: 'npm'
bun-version: "1.3.4"

- name: Install dependencies
run: npm ci
run: bun install --frozen-lockfile

- name: TypeScript check
run: npx tsc --noEmit
run: bunx tsc --noEmit

- name: ESLint
run: npx eslint .
run: bun run lint

- name: Push database schema
run: npx prisma db push --accept-data-loss
run: bun run db:push

- name: Seed database
run: npm run db:seed
run: bun run db:seed

- name: Unit tests
run: CI=true npx vitest run
run: CI=true bun run test

- name: Build
run: npm run build
run: bun run build

- name: Start server
run: |
npm run start -- -p 3000 &
nohup bun run start -- -p 3000 &
echo $! > server.pid
for i in $(seq 1 30); do
if curl -fsS http://localhost:3000 >/dev/null 2>&1; then
Expand All @@ -83,7 +82,7 @@ jobs:
exit 1

- name: Integration tests (live server)
run: CI=true TEST_BASE_URL=http://localhost:3000 npx vitest run __tests__/api/auth.test.ts __tests__/api/resources.test.ts __tests__/api/questions-interview-ai.test.ts __tests__/api/user-paths.test.ts
run: CI=true TEST_BASE_URL=http://localhost:3000 bun run test -- __tests__/api/auth.test.ts __tests__/api/resources.test.ts __tests__/api/questions-interview-ai.test.ts __tests__/api/user-paths.test.ts

- name: Stop server
if: always()
Expand All @@ -92,4 +91,4 @@ jobs:
- name: Secret scan (gitleaks)
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the workflow around the referenced lines and any permissions blocks.
if [ -f .github/workflows/ci.yml ]; then
  nl -ba .github/workflows/ci.yml | sed -n '1,220p'
fi

printf '\n--- search for permissions in workflows ---\n'
rg -n '^\s*permissions:|GITHUB_TOKEN:|gitleaks|audit token' .github/workflows -n

Repository: projectamazonph/Interview-lab

Length of output: 207


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the exact CI job snippet if the file exists.
sed -n '70,120p' .github/workflows/ci.yml 2>/dev/null || true

Repository: projectamazonph/Interview-lab

Length of output: 1060


🌐 Web query:

gitleaks GitHub Action required GITHUB_TOKEN permissions contents read pull-requests comments

💡 Result:

To ensure the Gitleaks GitHub Action functions correctly—specifically for scanning commits and posting comments on pull requests—you must configure the GITHUB_TOKEN with appropriate permissions in your workflow file [1][2][3]. If you are using default permissions that are restricted (common in many modern repository setups), you should explicitly define the following permissions in your workflow job [3][4]: permissions: contents: read pull-requests: write Explanation of required permissions: - contents: read: Required for the action to fetch and scan the code/commits in your repository [3][4]. - pull-requests: write: Required if you want the Gitleaks action to automatically post comments on your pull requests when a leak is detected [1][3]. If you only want to scan code without posting comments, contents: read is generally sufficient [3][4]. However, because the Gitleaks action is designed to interact with the GitHub API to report findings via PR comments, pull-requests: write is the standard recommendation to avoid "Resource not accessible by integration" errors [1][3].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the workflow top section and any permissions declarations.
sed -n '1,120p' .github/workflows/ci.yml 2>/dev/null || true
printf '\n--- permissions hits ---\n'
grep -n '^[[:space:]]*permissions:' .github/workflows/ci.yml 2>/dev/null || true
printf '\n--- gitleaks hits ---\n'
grep -n 'gitleaks\|pull-requests\|contents:' .github/workflows/ci.yml 2>/dev/null || true

Repository: projectamazonph/Interview-lab

Length of output: 2802


Add an explicit permissions block to the audit job. This workflow currently inherits the repo/org default GITHUB_TOKEN scope; set contents: read for the scan, and add pull-requests: write only if gitleaks-action needs to comment on PRs.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 10-94: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml at line 94, Add an explicit permissions block to
the audit job containing contents: read, and include pull-requests: write only
when the gitleaks-action configuration requires posting PR comments. Keep the
existing GITHUB_TOKEN environment variable and audit steps unchanged.

Source: Linters/SAST tools

2 changes: 1 addition & 1 deletion __tests__/api/user-paths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe('User Path: Resume Review Flow', () => {
expect(status).toBe(200);
expect(body).toHaveProperty('score');
expect(body).toHaveProperty('missingKeywords');
expect(body).toHaveProperty('improvedVersion');
expect(body).toHaveProperty('improvedSummary');
});

testIfServer('Step 3: Update resume with AI feedback', async () => {
Expand Down
2 changes: 1 addition & 1 deletion public/images/illustrations/ai-feedback-score.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 1 addition & 8 deletions public/images/illustrations/cover-letter-transformation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/images/illustrations/download-center.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/images/illustrations/learning-levels.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/images/illustrations/mock-interview-setup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/images/illustrations/onboarding-role-selection.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 1 addition & 10 deletions public/images/illustrations/practice-test-analysis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/images/illustrations/question-bank-library.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading