-
Notifications
You must be signed in to change notification settings - Fork 401
pull from master #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
pull from master #25
Changes from all commits
8218841
a982cc0
6e53b5b
2d003aa
efb967c
0ef9ad8
b90e87d
59213e0
ff40953
411b277
f88993f
1830c42
aae5126
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,90 +1,48 @@ | ||
| # Goal - I have to Lint, Build, Test the code for Frontend & Backend | ||
| # then Push the images to DockerHub | ||
| # Goal: Build the image for devboard frontend and push to docker hub | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| push: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| frontend: | ||
| # Github runner | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v7 | ||
| code-lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v7 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect the workflow and nearby lines with numbers.
git ls-files .github/workflows/ci.yml
wc -l .github/workflows/ci.yml
cat -n .github/workflows/ci.yml | sed -n '1,120p'Repository: LondheShubham153/devboard Length of output: 1682 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Map uses references in the workflow and search for policy mentions.
rg -n "uses:\s*(actions/checkout|actions/setup-node|docker/login-action|docker/build-push-action)@" .github/workflows/ci.yml
rg -n "immutable commit SHA|pin.*SHA|supply-chain|actions/" .github/workflows .github README.md docs 2>/dev/null || trueRepository: LondheShubham153/devboard Length of output: 1161 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Also inspect any workflow comments or references that may justify the choice.
sed -n '1,140p' .github/workflows/ci.yml | nl -baRepository: LondheShubham153/devboard Length of output: 203 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Search for the exact action references and version pins.
rg -n "uses:\s*(actions/checkout|actions/setup-node|docker/login-action|docker/build-push-action)@" .github/workflows/ci.ymlRepository: LondheShubham153/devboard Length of output: 361 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Print the workflow with line numbers and extract all action refs.
echo '--- ci.yml ---'
cat -n .github/workflows/ci.yml | sed -n '1,120p'
echo '--- action refs ---'
python3 - <<'PY'
import re, pathlib
text = pathlib.Path('.github/workflows/ci.yml').read_text()
for i, line in enumerate(text.splitlines(), 1):
m = re.search(r'uses:\s*([^\s]+)', line)
if m:
print(f"{i}: {m.group(1)}")
PYRepository: LondheShubham153/devboard Length of output: 1797 Pin all workflow Actions to immutable commit SHAs.
🧰 Tools🪛 zizmor (1.26.1)[warning] 12-13: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 13-13: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
|
|
||
| - name: Set up Node js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 24 | ||
|
|
||
| - name: Install node.js dependecies | ||
| working-directory: frontend | ||
| run: npm ci | ||
|
|
||
| - name: Run ESLint | ||
| working-directory: frontend | ||
| run: npm run lint | ||
|
|
||
| build-and-push: | ||
| needs: code-lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Docker setup [Login to Docker] | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| username: ${{ vars.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Docker Build and Push | ||
| uses: docker/build-push-action@v7 | ||
| with: | ||
| context: frontend | ||
| file: frontend/Dockerfile | ||
| push: true | ||
| tags: ${{ vars.DOCKERHUB_USERNAME }}/devboard-fe-master:latest | ||
|
|
||
| - name: Setup NodeJs | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '20' | ||
| cache: npm | ||
| cache-dependency-path: frontend/package-lock.json | ||
|
|
||
| - name: Install npm Packages | ||
| run: npm install | ||
| working-directory: frontend | ||
|
|
||
| - name: Run Linter | ||
| run: npm run lint | ||
| working-directory: frontend | ||
|
|
||
| - name: Run Tests | ||
| run: npm run test | ||
| working-directory: frontend | ||
|
|
||
| - name: Docker Setup [Login] | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| username: ${{ vars.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Docker Build and Push | ||
| uses: docker/build-push-action@v7 | ||
| with: | ||
| context: ./frontend | ||
| push: true | ||
| tags: ${{ vars.DOCKERHUB_USERNAME }}/devboard-frontend:latest | ||
|
|
||
| backend: | ||
| # Github runner | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| go-version-file: 'go.mod' | ||
| cache-dependency-path: go.sum | ||
|
|
||
| - name: Run Go Formatter | ||
| run: go fmt | ||
| working-directory: backend | ||
|
|
||
| - name: Run Go Vet | ||
| run: go vet | ||
| working-directory: backend | ||
|
|
||
| - name: Run Tests | ||
| run: go test | ||
| working-directory: backend | ||
|
|
||
| - name: Docker Setup [Login] | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| username: ${{ vars.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Docker Build and Push | ||
| uses: docker/build-push-action@v7 | ||
| with: | ||
| context: ./backend | ||
| push: true | ||
| tags: ${{ vars.DOCKERHUB_USERNAME }}/devboard-backend:latest | ||
| deploy: | ||
| needs: [frontend,backend] | ||
| uses: ./.github/workflows/cd.yml | ||
| secrets: inherit | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Add explicit least-privilege
permissionsat workflow level.Relying on default token scopes is broader than needed; define minimal permissions (for this workflow,
contents: readis typically sufficient).Suggested patch
on: push: branches: [master] +permissions: + contents: read + jobs:📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Linters/SAST tools