|
27 | 27 | echo "Source Title: $RELEASE_TITLE" |
28 | 28 | echo "Source Tag: $RELEASE_TAG" |
29 | 29 |
|
| 30 | + TARGET_REPO="KudoAI/ai-personas" |
30 | 31 | RELEASE_JSON=$(curl -s "https://api.github.com/repos/adamlui/python-utils/releases/tags/$RELEASE_TAG") |
31 | 32 | RELEASE_NOTES=$(echo "$RELEASE_JSON" | sed -nE 's/.*"body": "(.*)".*/\1/p') |
32 | 33 |
|
|
44 | 45 |
|
45 | 46 | # Check release exists in KudoAI/ai-personas |
46 | 47 | RELEASE_CHECK_RESP=$(curl -s \ |
47 | | - "https://api.github.com/repos/KudoAI/ai-personas/releases/tags/$TARGET_RELEASE_TAG") |
| 48 | + "https://api.github.com/repos/$TARGET_REPO/releases/tags/$TARGET_RELEASE_TAG") |
48 | 49 | TARGET_RELEASE_ID=$(echo "$RELEASE_CHECK_RESP" | sed -nE 's/.*"id":[[:space:]]*([0-9]+).*/\1/p' | head -1) |
49 | 50 | if [ -n "$TARGET_RELEASE_ID" ] ; then |
50 | 51 | RELEASE_EXISTS=true |
|
60 | 61 |
|
61 | 62 | if [ "$RELEASE_EXISTS" = false ] ; then |
62 | 63 | echo "Creating new release..." |
63 | | - create_release_url="https://api.github.com/repos/KudoAI/ai-personas/releases" |
| 64 | + create_release_url="https://api.github.com/repos/$TARGET_REPO/releases" |
64 | 65 | create_release_payload=$( |
65 | 66 | printf '{"tag_name": "%s","name": "%s","body": "%s"}' \ |
66 | 67 | "$TARGET_RELEASE_TAG" "$TARGET_RELEASE_TITLE" "$RELEASE_NOTES") |
|
74 | 75 | upload_url=$(echo "$create_release_resp" | sed -nE 's|.*"upload_url": "(.*)".*|\1|p' | sed 's|{.*}||') |
75 | 76 | else |
76 | 77 | echo "Updating existing release..." |
77 | | - update_release_url="https://api.github.com/repos/KudoAI/ai-personas/releases/$TARGET_RELEASE_ID" |
| 78 | + update_release_url="https://api.github.com/repos/$TARGET_REPO/releases/$TARGET_RELEASE_ID" |
78 | 79 | update_release_payload=$( |
79 | 80 | printf '{"name": "%s","body": "%s"}' \ |
80 | 81 | "$TARGET_RELEASE_TITLE" "$RELEASE_NOTES") |
|
86 | 87 | exit 1 |
87 | 88 | fi |
88 | 89 | get_release_resp=$(curl -s -S -H "Authorization: Bearer ${{ steps.ksb-token.outputs.token }}" \ |
89 | | - "https://api.github.com/repos/KudoAI/ai-personas/releases/tags/$TARGET_RELEASE_TAG") |
| 90 | + "https://api.github.com/repos/$TARGET_REPO/releases/tags/$TARGET_RELEASE_TAG") |
90 | 91 | upload_url=$(echo "$get_release_resp" | sed -nE 's|.*"upload_url": "(.*)".*|\1|p' | sed 's|{.*}||') |
91 | 92 | fi |
92 | 93 |
|
93 | | - echo "Release synced to KudoAI/ai-personas ($TARGET_RELEASE_TAG)!" |
| 94 | + echo "Release synced to $TARGET_REPO ($TARGET_RELEASE_TAG)!" |
0 commit comments