forked from docs/doc-exports
Debugging stuff
This commit is contained in:
@ -44,13 +44,24 @@ jobs:
|
||||
- name: Comment on PR with violations
|
||||
if: failure() && steps.underscore-check.outcome == 'failure'
|
||||
env:
|
||||
GITEA_URL: ${{ gitea.server_url }}
|
||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||
REPO: ${{ gitea.repository }}
|
||||
PR_NUMBER: ${{ gitea.event.pull_request.number }}
|
||||
TOKEN: ${{ gitea.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# Debug: print environment variables
|
||||
echo "GITEA_SERVER_URL: ${GITEA_SERVER_URL}"
|
||||
echo "REPO: ${REPO}"
|
||||
echo "PR_NUMBER: ${PR_NUMBER}"
|
||||
|
||||
# Ensure URL starts with http
|
||||
if [[ ! "${GITEA_SERVER_URL}" =~ ^https?:// ]]; then
|
||||
GITEA_SERVER_URL="http://${GITEA_SERVER_URL}"
|
||||
echo "Added http:// prefix to URL"
|
||||
fi
|
||||
|
||||
# Generate comment message
|
||||
MSG=$(python3 .gitea/workflows/generate-comment.py)
|
||||
echo "$MSG"
|
||||
@ -58,11 +69,15 @@ jobs:
|
||||
# Extract body from JSON
|
||||
BODY=$(echo "$MSG" | python3 -c "import sys, json; print(json.load(sys.stdin)['body'])")
|
||||
|
||||
# Build the full URL
|
||||
FULL_URL="${GITEA_SERVER_URL}/api/v1/repos/${REPO}/issues/${PR_NUMBER}/comments"
|
||||
echo "Posting comment to: ${FULL_URL}"
|
||||
|
||||
# Comment on PR
|
||||
curl -sS --fail-with-body -X POST \\
|
||||
-H "Authorization: token ${TOKEN}" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
"${GITEA_URL}/api/v1/repos/${REPO}/issues/${PR_NUMBER}/comments" \\
|
||||
curl -sS -X POST \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${FULL_URL}" \
|
||||
-d "$(echo "$BODY" | python3 -c "import sys, json; print(json.dumps({'body': sys.stdin.read()}))")"
|
||||
|
||||
- name: Final status
|
||||
|
||||
Reference in New Issue
Block a user