@@ -34,10 +34,12 @@ jobs:
3434 # Get the commit hash from the tag
3535 - name : Get commit hash
3636 id : get_commit
37+ env :
38+ INPUT_TAG : ${{ github.event.inputs.tag }}
3739 run : |
3840 COMMIT_HASH=$(git rev-parse HEAD)
3941 echo "commit_hash=$COMMIT_HASH" >> $GITHUB_OUTPUT
40- echo "Found commit: $COMMIT_HASH for tag ${{ github.event.inputs.tag }} "
42+ echo "Found commit: $COMMIT_HASH for tag $INPUT_TAG "
4143
4244 # Now checkout the fork at main branch
4345 - name : Checkout fork
@@ -445,42 +447,48 @@ jobs:
445447 # Add upstream and get commit from tag
446448 - name : Get upstream tag commit
447449 id : get_upstream_commit
450+ env :
451+ INPUT_TAG : ${{ github.event.inputs.tag }}
448452 run : |
449453 # Add upstream remote
450454 git remote add upstream https://github.com/MervinPraison/PraisonAI.git
451455
452456 # Delete local tag if it exists
453- git tag -d ${{ github.event.inputs.tag }} || true
457+ git tag -d "$INPUT_TAG" || true
454458
455459 # Fetch from upstream including tags with force
456460 git fetch upstream --tags --force
457461
458462 # Verify tag exists in upstream
459- if ! git ls-remote --tags upstream | grep -q "refs/tags/${{ github.event.inputs.tag }} $"; then
460- echo "::error::Tag ${{ github.event.inputs.tag }} not found in upstream repository"
463+ if ! git ls-remote --tags upstream | grep -q "refs/tags/$INPUT_TAG $"; then
464+ echo "::error::Tag $INPUT_TAG not found in upstream repository"
461465 exit 1
462466 fi
463467
464468 # Get the commit hash from the upstream tag
465- UPSTREAM_COMMIT=$(git rev-list -n 1 refs/tags/${{ github.event.inputs.tag }} )
469+ UPSTREAM_COMMIT=$(git rev-list -n 1 refs/tags/"$INPUT_TAG" )
466470 if [ -z "$UPSTREAM_COMMIT" ]; then
467- echo "::error::Could not find commit for tag ${{ github.event.inputs.tag }} "
471+ echo "::error::Could not find commit for tag $INPUT_TAG "
468472 exit 1
469473 fi
470474 echo "upstream_commit=$UPSTREAM_COMMIT" >> $GITHUB_OUTPUT
471- echo "Found commit: $UPSTREAM_COMMIT for tag ${{ github.event.inputs.tag }} "
475+ echo "Found commit: $UPSTREAM_COMMIT for tag $INPUT_TAG "
472476
473477 # Create tag at the same commit
474478 - name : Create tag at commit
479+ env :
480+ GIT_ASKPASS : /bin/echo
481+ PAT_TOKEN : ${{ secrets.PAT_TOKEN }}
482+ INPUT_TAG : ${{ github.event.inputs.tag }}
475483 run : |
476484 git config --global user.name "MervinPraison"
477485 git config --global user.email "454862+MervinPraison@users.noreply.github.com"
478486
479487 # Remove tag if it exists locally
480- git tag -d ${{ github.event.inputs.tag }} || true
488+ git tag -d "$INPUT_TAG" || true
481489
482490 # Remove tag if it exists remotely
483- git push origin :refs/tags/${{ github.event.inputs.tag }} || true
491+ git push origin :refs/tags/"$INPUT_TAG" || true
484492
485493 # Fetch the specific commit from upstream
486494 git fetch upstream ${{ steps.get_upstream_commit.outputs.upstream_commit }} --force
@@ -489,11 +497,8 @@ jobs:
489497 git reset --hard ${{ steps.get_upstream_commit.outputs.upstream_commit }}
490498
491499 # Create and push tag
492- git tag -a ${{ github.event.inputs.tag }} -m "Release ${{ github.event.inputs.tag }} (synced from upstream MervinPraison/PraisonAI@${{ github.event.inputs.tag }})"
493- git push origin ${{ github.event.inputs.tag }}
494- env :
495- GIT_ASKPASS : /bin/echo
496- PAT_TOKEN : ${{ secrets.PAT_TOKEN }}
500+ git tag -a "$INPUT_TAG" -m "Release $INPUT_TAG (synced from upstream MervinPraison/PraisonAI@$INPUT_TAG)"
501+ git push origin "$INPUT_TAG"
497502
498503 # Create the release
499504 - name : Create Release
0 commit comments