Replace server url info with variables

This commit is contained in:
Antoine Martin 2024-10-27 13:20:29 -04:00
parent 51d73aa17e
commit 94b837d974
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -18,7 +18,7 @@ does_it_exist() {
query="$(echo $query | sed 's| |%20|g')"
result="$(curl --silent -X 'GET' \
"https://ayakael.net/api/v1/repos/alpine/apkgwatch/issues?state=open&q=$query&type=issues" \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN"
)"
@ -35,7 +35,7 @@ is_it_old() {
repo=$4
result="$(curl --silent -X 'GET' \
"https://ayakael.net/api/v1/repos/alpine/apkgwatch/issues?state=open&q=$name&type=issues" \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$name&type=issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN"
)"
@ -60,7 +60,7 @@ update_title() {
id=$5
result=$(curl --silent -X 'PATCH' \
"https://ayakael.net/api/v1/repos/alpine/apkgwatch/issues/$id" \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$id" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \
-H 'Content-Type: application/json' \
@ -79,7 +79,7 @@ create_issue() {
repo=$4
result=$(curl --silent -X 'POST' \
'https://ayakael.net/api/v1/repos/alpine/apkgwatch/issues' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \
-H 'Content-Type: application/json' \
@ -125,7 +125,7 @@ if [ -f not_in_anitya ]; then
query="$(echo $query | sed 's| |%20|g')"
result="$(curl --silent -X 'GET' \
"https://ayakael.net/api/v1/repos/alpine/apkgwatch/issues?state=open&q=$query&type=issues" \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN"
)"
@ -133,7 +133,7 @@ if [ -f not_in_anitya ]; then
if [ "$result" == "[]" ]; then
echo "Creating anitya issue"
result=$(curl --silent -X 'POST' \
'https://ayakael.net/api/v1/repos/alpine/apkgwatch/issues' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \
-H 'Content-Type: application/json' \
@ -146,7 +146,7 @@ if [ -f not_in_anitya ]; then
echo "Updating anitya issue"
result_id="$(echo $result | jq -r '.[].number' )"
result=$(curl --silent -X 'PATCH' \
"https://ayakael.net/api/v1/repos/alpine/apkgwatch/issues/$result_id" \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$result_id" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \
-H 'Content-Type: application/json' \