-
Notifications
You must be signed in to change notification settings - Fork 3
ci: set up build and lint GitHub Action workflow #31
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: main
Are you sure you want to change the base?
Changes from all commits
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,12 +1,30 @@ | ||
| name: Test Workflow | ||
| name: CI Build and Lint | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| test: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Hello | ||
| run: echo "Workflow is working!" | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
|
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. P2: Pin Prompt for AI agents |
||
| with: | ||
| node-version: 18 | ||
| cache: 'npm' | ||
|
Comment on lines
+14
to
+21
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 | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
resolve_tag() {
local repo="$1"
local tag="$2"
local type sha
read -r type sha < <(
curl -fsSL "https://api.github.com/repos/${repo}/git/ref/tags/${tag}" \
| jq -r '.object.type, .object.sha' \
| paste - -)
if [ "$type" = "tag" ]; then
sha=$(curl -fsSL "https://api.github.com/repos/${repo}/git/tags/${sha}" | jq -r '.object.sha')
fi
echo "${repo}@${tag} -> ${sha}"
}
resolve_tag actions/checkout v4
resolve_tag actions/setup-node v4Repository: itzzavdhesh/FlowCraft Length of output: 250 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== .github/workflows/main.yml =="
cat -n .github/workflows/main.yml
echo
echo "== package.json =="
cat -n package.json
echo
echo "== Search for git/auth usage in workflow files =="
rg -n "persist-credentials|git |github-token|checkout@|setup-node@" .github/workflows . -g '!node_modules' -g '!dist' -g '!build'Repository: itzzavdhesh/FlowCraft Length of output: 2550 Pin the GitHub Actions and disable persisted checkout credentials.
🧰 Tools🪛 zizmor (1.26.1)[warning] 14-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 18-18: 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: Install Dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run Lint (Type Check) | ||
| run: npm run lint | ||
|
|
||
| - name: Build Project | ||
| run: npm run build | ||
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.
P1: Pin
actions/checkoutto a full-length commit SHA and disable credential persistence here. The default checkout behavior stores the token in local git config, which is unnecessary for this workflow and broadens token exposure to later script steps.Prompt for AI agents