feat: ci cd pipelien #1
@@ -129,9 +129,15 @@ jobs:
|
||||
droast --no-roast --min-severity warning .
|
||||
|
||||
# ------------------------------------------------------- snyk security ----
|
||||
# DISABLED: Snyk free plan only includes ~100 test credits/month, which the
|
||||
# pipeline would burn through quickly (2 tests per PR push).
|
||||
# To re-enable, delete the "if: false" line below. Consider also running
|
||||
# this job only on PRs marked "ready for review" or on a weekly schedule
|
||||
# instead of on every push.
|
||||
snyk:
|
||||
name: Security scan (Snyk)
|
||||
runs-on: ubuntu-latest
|
||||
if: false
|
||||
# snyk/snyk:node is amd64-only ("no matching manifest for linux/arm64"),
|
||||
# so install the CLI via npm in the multi-arch node image instead
|
||||
container: node:22-bookworm
|
||||
@@ -221,8 +227,15 @@ jobs:
|
||||
run: |
|
||||
# jq is not in the node image - use node for JSON encoding
|
||||
BODY=$(node -e 'process.stdout.write(JSON.stringify(require("fs").readFileSync("/tmp/review.md","utf8")))')
|
||||
curl -sf -X POST \
|
||||
HTTP_CODE=$(curl -s -o /tmp/comment-response.json -w "%{http_code}" \
|
||||
-X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"body\": ${BODY}}" \
|
||||
"${GITHUB_API_URL}/repos/${REPO}/issues/${PR_NUMBER}/comments"
|
||||
"${GITHUB_API_URL}/repos/${REPO}/issues/${PR_NUMBER}/comments")
|
||||
echo "POST status: ${HTTP_CODE}"
|
||||
cat /tmp/comment-response.json
|
||||
case "$HTTP_CODE" in
|
||||
200|201) echo "Review comment posted." ;;
|
||||
*) echo "::error::Failed to post review comment (HTTP ${HTTP_CODE}) - check PR_GITEA_TOKEN scope and expiry" ;;
|
||||
esac
|
||||
Reference in new issue
Block a user