fix gitea env var
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2023-08-17 10:49:31 +02:00
parent 9057dd957c
commit a17f171015
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0

View File

@ -9,10 +9,10 @@ GITEA_TOKEN=my-private-token
GITEA_USER="gitea"
GITEA_PR_TITLE=
http "https://${GITEA_SERVER}/api/v1/user" 'Authorization:token '"${GITEA_TOKEN}"''
http "${GITEA_SERVER}/api/v1/user" 'Authorization:token '"${GITEA_TOKEN}"''
for repo in $(http -b "https://${GITEA_SERVER}/api/v1/users/${GITEA_USER}/repos" 'Authorization:token '"${GITEA_TOKEN}"'' | jq -r '.[] | .full_name'); do
for pr_number in $(http -b "https://${GITEA_SERVER}/api/v1/repos/${repo}/pulls" 'Authorization:token '"${GITEA_TOKEN}"'' state==open | jq -r '.[] | select(.title | contains("'"${GITEA_PR_TITLE}"'")) | .number'); do
http POST "https://${GITEA_SERVER}/api/v1/repos/${repo}/pulls/${pr_number}/merge" 'Authorization:token '"${GITEA_TOKEN}"'' do=squash
for repo in $(http -b "${GITEA_SERVER}/api/v1/users/${GITEA_USER}/repos" 'Authorization:token '"${GITEA_TOKEN}"'' | jq -r '.[] | .full_name'); do
for pr_number in $(http -b "${GITEA_SERVER}/api/v1/repos/${repo}/pulls" 'Authorization:token '"${GITEA_TOKEN}"'' state==open | jq -r '.[] | select(.title | contains("'"${GITEA_PR_TITLE}"'")) | .number'); do
http POST "${GITEA_SERVER}/api/v1/repos/${repo}/pulls/${pr_number}/merge" 'Authorization:token '"${GITEA_TOKEN}"'' do=squash
done
done