forgejo: fix is_it_old function query logic
This commit is contained in:
parent
eaf4fd7fe1
commit
da8868f5bf
1 changed files with 6 additions and 4 deletions
|
@ -15,7 +15,7 @@ does_it_exist() {
|
|||
repo=$4
|
||||
|
||||
query="$repo/$name: upgrade to $upstream_version"
|
||||
query="$(echo $query | sed 's| |%20|g')"
|
||||
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" \
|
||||
|
@ -34,8 +34,11 @@ is_it_old() {
|
|||
upstream_version=$3
|
||||
repo=$4
|
||||
|
||||
query="$repo/$name: upgrade to $upstream_version"
|
||||
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=$name&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"
|
||||
)"
|
||||
|
@ -107,7 +110,6 @@ if [ -f out_of_date ]; then
|
|||
fi
|
||||
|
||||
id=$(is_it_old $name $downstream_version $upstream_version $repo)
|
||||
echo $id
|
||||
|
||||
if [ "$id" != "0" ] && [ -n "$id" ]; then
|
||||
echo "Issue for $repo/$name needs updating"
|
||||
|
@ -141,7 +143,7 @@ if [ -f not_in_anitya ]; then
|
|||
\"title\": \"Add missing $repo packages to anitya\",
|
||||
\"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\"
|
||||
}")
|
||||
echo $result
|
||||
|
||||
else
|
||||
echo "Updating anitya issue"
|
||||
result_id="$(echo $result | jq -r '.[].number' )"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue