Skip to content

Commit d4d83eb

Browse files
committed
Extracted TARGET_REPO
1 parent a1d57b8 commit d4d83eb

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/sync-ai-personas-releases-to-project-repo.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
echo "Source Title: $RELEASE_TITLE"
2828
echo "Source Tag: $RELEASE_TAG"
2929
30+
TARGET_REPO="KudoAI/ai-personas"
3031
RELEASE_JSON=$(curl -s "https://api.github.com/repos/adamlui/python-utils/releases/tags/$RELEASE_TAG")
3132
RELEASE_NOTES=$(echo "$RELEASE_JSON" | sed -nE 's/.*"body": "(.*)".*/\1/p')
3233
@@ -44,7 +45,7 @@ jobs:
4445
4546
# Check release exists in KudoAI/ai-personas
4647
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")
4849
TARGET_RELEASE_ID=$(echo "$RELEASE_CHECK_RESP" | sed -nE 's/.*"id":[[:space:]]*([0-9]+).*/\1/p' | head -1)
4950
if [ -n "$TARGET_RELEASE_ID" ] ; then
5051
RELEASE_EXISTS=true
@@ -60,7 +61,7 @@ jobs:
6061
6162
if [ "$RELEASE_EXISTS" = false ] ; then
6263
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"
6465
create_release_payload=$(
6566
printf '{"tag_name": "%s","name": "%s","body": "%s"}' \
6667
"$TARGET_RELEASE_TAG" "$TARGET_RELEASE_TITLE" "$RELEASE_NOTES")
@@ -74,7 +75,7 @@ jobs:
7475
upload_url=$(echo "$create_release_resp" | sed -nE 's|.*"upload_url": "(.*)".*|\1|p' | sed 's|{.*}||')
7576
else
7677
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"
7879
update_release_payload=$(
7980
printf '{"name": "%s","body": "%s"}' \
8081
"$TARGET_RELEASE_TITLE" "$RELEASE_NOTES")
@@ -86,8 +87,8 @@ jobs:
8687
exit 1
8788
fi
8889
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")
9091
upload_url=$(echo "$get_release_resp" | sed -nE 's|.*"upload_url": "(.*)".*|\1|p' | sed 's|{.*}||')
9192
fi
9293
93-
echo "Release synced to KudoAI/ai-personas ($TARGET_RELEASE_TAG)!"
94+
echo "Release synced to $TARGET_REPO ($TARGET_RELEASE_TAG)!"

0 commit comments

Comments
 (0)