fix: mistyped Accept header?
For some reason `forgejo` returns HTML from a comment update request.
This commit is contained in:
parent
73142cfab8
commit
18b0da5f8f
3 changed files with 5 additions and 5 deletions
|
@ -81,7 +81,7 @@ runs:
|
||||||
prs=$(curl -X 'GET' \
|
prs=$(curl -X 'GET' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?state=open&sort=recentupdate" \
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?state=open&sort=recentupdate" \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'accept: application/json')
|
-H 'Accept: application/json')
|
||||||
|
|
||||||
pr_number=$(echo "$prs" |
|
pr_number=$(echo "$prs" |
|
||||||
jq --arg head_ref "$head_ref" '.[] | select(.head.ref == $head_ref) | .number')
|
jq --arg head_ref "$head_ref" '.[] | select(.head.ref == $head_ref) | .number')
|
||||||
|
|
|
@ -140,7 +140,7 @@ if [ -z "$COMMENT_ID" ]; then
|
||||||
log 'Posting new comment'
|
log 'Posting new comment'
|
||||||
curl -o - -X 'POST' \
|
curl -o - -X 'POST' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_ID/comments" \
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_ID/comments" \
|
||||||
-H 'accept: application/json' \
|
-H 'Accept: application/json' \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d "$data"
|
-d "$data"
|
||||||
|
@ -148,7 +148,7 @@ else
|
||||||
log "Editing comment $COMMENT_ID"
|
log "Editing comment $COMMENT_ID"
|
||||||
curl -o - -X 'PATCH' \
|
curl -o - -X 'PATCH' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_ID/comments/$COMMENT_ID" \
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_ID/comments/$COMMENT_ID" \
|
||||||
-H 'accept: application/json' \
|
-H 'Accept: application/json' \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d "$data"
|
-d "$data"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
repo_info() {
|
repo_info() {
|
||||||
curl -X GET \
|
curl -X GET \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'accept: application/json' \
|
-H 'Accept: application/json' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY"
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ base_report_url() {
|
||||||
curl -X 'GET' \
|
curl -X 'GET' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/tasks" \
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/tasks" \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'accept: application/json' |
|
-H 'Accept: application/json' |
|
||||||
jq --raw-output \
|
jq --raw-output \
|
||||||
--arg name "$JOB_NAME" \
|
--arg name "$JOB_NAME" \
|
||||||
--arg head_branch "$1" \
|
--arg head_branch "$1" \
|
||||||
|
|
Loading…
Add table
Reference in a new issue