diff --git a/.forgejo/bin/create_issue.sh b/.forgejo/bin/create_issue.sh index dbc6557..6369371 100755 --- a/.forgejo/bin/create_issue.sh +++ b/.forgejo/bin/create_issue.sh @@ -18,8 +18,9 @@ does_it_exist() { query="$(echo $query | sed 's| |%20|g' | sed 's|:|%3A|g' | sed 's|/|%2F|g' )" result="$(curl --silent -X 'GET' \ - "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues&token=$ISSUE_TOKEN" \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ -H 'accept: application/json' \ + -H "Authorization: token $ISSUE_TOKEN" )" if [ "$result" == "[]" ]; then @@ -39,7 +40,7 @@ is_it_old() { result="$(curl --silent -X 'GET' \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ -H 'accept: application/json' \ - -H "authorization: $ISSUE_TOKEN" + -H "authorization: token $ISSUE_TOKEN" )" result_title="$(echo $result | jq -r '.[].title' )" @@ -63,7 +64,7 @@ update_title() { result=$(curl --silent -X 'PATCH' \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$id" \ -H 'accept: application/json' \ - -H "authorization: $ISSUE_TOKEN" \ + -H "authorization: token $ISSUE_TOKEN" \ -H 'Content-Type: application/json' \ -d "{ \"title\": \"$repo/$name: upgrade to $upstream_version\" @@ -82,7 +83,7 @@ create_issue() { result=$(curl --silent -X 'POST' \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \ -H 'accept: application/json' \ - -H "authorization: $ISSUE_TOKEN" \ + -H "authorization: token $ISSUE_TOKEN" \ -H 'Content-Type: application/json' \ -d "{ \"title\": \"$repo/$name: upgrade to $upstream_version\", @@ -130,7 +131,7 @@ if [ -f not_in_anitya ]; then result="$(curl --silent -X 'GET' \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ -H 'accept: application/json' \ - -H "authorization: $ISSUE_TOKEN" + -H "authorization: token $ISSUE_TOKEN" )" if [ "$result" == "[]" ]; then @@ -138,7 +139,7 @@ if [ -f not_in_anitya ]; then result=$(curl --silent -X 'POST' \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \ -H 'accept: application/json' \ - -H "authorization: $ISSUE_TOKEN" \ + -H "authorization: token $ISSUE_TOKEN" \ -H 'Content-Type: application/json' \ -d "{ \"title\": \"Add missing $repo packages to anitya\", @@ -154,7 +155,7 @@ if [ -f not_in_anitya ]; then result=$(curl --silent -X 'PATCH' \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$result_id" \ -H 'accept: application/json' \ - -H "authorization: $ISSUE_TOKEN" \ + -H "authorization: token $ISSUE_TOKEN" \ -H 'Content-Type: application/json' \ -d "{ \"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\"