ci: hardcode gitea.com domain (#808)

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/808
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.com>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
This commit is contained in:
pat-s 2025-02-23 15:30:58 +00:00 committed by justusbunsi
parent f74ab67b59
commit 9f659afc47

View File

@ -20,13 +20,13 @@ jobs:
run: |
git sv rn -o changelog.md
export RELEASE_NOTES=$(cat changelog.md)
export ISSUE_NUMBER=$(curl -s "${{ gitea.event.repository.html_url }}/api/v1/repos/${{ gitea.repository }}/issues?state=open&q=Changelog%20for%20upcoming%20version" | jq '.[].number')
export ISSUE_NUMBER=$(curl -s "https://gitea.com/api/v1/repos/gitea/helm-chart/issues?state=open&q=Changelog%20for%20upcoming%20version" | jq '.[].number')
echo $RELEASE_NOTES
JSON_DATA=$(echo "" | jq -Rs --arg title 'Changelog for upcoming version' --arg body "$(cat changelog.md)" '{title: $title, body: $body}')
if [ -z "$ISSUE_NUMBER" ]; then
curl -s -X POST "${{ gitea.event.repository.html_url }}/api/v1/repos/${{ gitea.repository }}/issues?token=${{ secrets.ISSUE_RW_TOKEN }}" -H "Content-Type: application/json" -d "$JSON_DATA"
curl -s -X POST "https://gitea.com/api/v1/repos/gitea/helm-chart/issues" -H "Authorization: token ${{ secrets.ISSUE_RW_TOKEN }}" -H "Content-Type: application/json" -d "$JSON_DATA"
else
curl -s -X PATCH "${{ gitea.event.repository.html_url }}/api/v1/repos/${{ gitea.repository }}/issues/$ISSUE_NUMBER?token=${{ secrets.ISSUE_RW_TOKEN }}" -H "Content-Type: application/json" -d "$JSON_DATA"
curl -s -X PATCH "https://gitea.com/api/v1/repos/gitea/helm-chart/issues/$ISSUE_NUMBER" -H "Authorization: token ${{ secrets.ISSUE_RW_TOKEN }}" -H "Content-Type: application/json" -d "$JSON_DATA"
fi