mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-05 16:53:29 +08:00
Merge pull request #9 from pangerlkr/claude/fix-agentshield-security-scan
Fix test failures and remove broken AgentShield workflow
This commit is contained in:
34
.github/workflows/security-scan.yml
vendored
34
.github/workflows/security-scan.yml
vendored
@@ -1,34 +0,0 @@
|
|||||||
name: AgentShield Security Scan
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
# Prevent duplicate runs
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
# Minimal permissions
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
agentshield:
|
|
||||||
name: AgentShield Scan
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Run AgentShield Security Scan
|
|
||||||
uses: affaan-m/agentshield@v1
|
|
||||||
with:
|
|
||||||
path: '.'
|
|
||||||
min-severity: 'medium'
|
|
||||||
format: 'terminal'
|
|
||||||
fail-on-findings: 'false'
|
|
||||||
@@ -370,28 +370,31 @@ function escapeRegex(str) {
|
|||||||
function getCommandPattern(action) {
|
function getCommandPattern(action) {
|
||||||
const patterns = [];
|
const patterns = [];
|
||||||
|
|
||||||
if (action === 'dev') {
|
// Trim spaces from action to handle leading/trailing whitespace gracefully
|
||||||
|
const trimmedAction = action.trim();
|
||||||
|
|
||||||
|
if (trimmedAction === 'dev') {
|
||||||
patterns.push(
|
patterns.push(
|
||||||
'npm run dev',
|
'npm run dev',
|
||||||
'pnpm( run)? dev',
|
'pnpm( run)? dev',
|
||||||
'yarn dev',
|
'yarn dev',
|
||||||
'bun run dev'
|
'bun run dev'
|
||||||
);
|
);
|
||||||
} else if (action === 'install') {
|
} else if (trimmedAction === 'install') {
|
||||||
patterns.push(
|
patterns.push(
|
||||||
'npm install',
|
'npm install',
|
||||||
'pnpm install',
|
'pnpm install',
|
||||||
'yarn( install)?',
|
'yarn( install)?',
|
||||||
'bun install'
|
'bun install'
|
||||||
);
|
);
|
||||||
} else if (action === 'test') {
|
} else if (trimmedAction === 'test') {
|
||||||
patterns.push(
|
patterns.push(
|
||||||
'npm test',
|
'npm test',
|
||||||
'pnpm test',
|
'pnpm test',
|
||||||
'yarn test',
|
'yarn test',
|
||||||
'bun test'
|
'bun test'
|
||||||
);
|
);
|
||||||
} else if (action === 'build') {
|
} else if (trimmedAction === 'build') {
|
||||||
patterns.push(
|
patterns.push(
|
||||||
'npm run build',
|
'npm run build',
|
||||||
'pnpm( run)? build',
|
'pnpm( run)? build',
|
||||||
@@ -400,7 +403,7 @@ function getCommandPattern(action) {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Generic run command — escape regex metacharacters in action
|
// Generic run command — escape regex metacharacters in action
|
||||||
const escaped = escapeRegex(action);
|
const escaped = escapeRegex(trimmedAction);
|
||||||
patterns.push(
|
patterns.push(
|
||||||
`npm run ${escaped}`,
|
`npm run ${escaped}`,
|
||||||
`pnpm( run)? ${escaped}`,
|
`pnpm( run)? ${escaped}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user