fix(ci): JSON-encode review with node instead of jq
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 34s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 5s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Security scan (Snyk) (pull_request) Failing after 32s
PR Check / AI code review (opencode) (pull_request) Successful in 8s
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 34s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 5s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Security scan (Snyk) (pull_request) Failing after 32s
PR Check / AI code review (opencode) (pull_request) Successful in 8s
The node:22-bookworm image does not ship jq. Also use the renamed PR_GITEA_TOKEN secret.
This commit is contained in:
1 parent
4f3d16cef9
commit
a061fad9b1
1 file changed
+3
-2
@@ -214,12 +214,13 @@ jobs:
|
|||||||
- name: Post review as PR comment
|
- name: Post review as PR comment
|
||||||
continue-on-error: true # token missing/expired must not fail the build
|
continue-on-error: true # token missing/expired must not fail the build
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.PR_GITEA_TOKEN }}
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
# Gitea sets GITHUB_API_URL, e.g. https://gitea.example.com/api/v1
|
# Gitea sets GITHUB_API_URL, e.g. https://gitea.example.com/api/v1
|
||||||
run: |
|
run: |
|
||||||
BODY=$(jq -Rs . < /tmp/review.md)
|
# 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 \
|
curl -sf -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
|
|||||||
Reference in new issue
Block a user