Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

chore: edit preview url on pr comments

Minh14112082206954e9be
diff --git a/.github/workflows/jan-server-web-ci.yml b/.github/workflows/jan-server-web-ci.yml
index 426a7da35..53d18a429 100644
--- a/.github/workflows/jan-server-web-ci.yml
+++ b/.github/workflows/jan-server-web-ci.yml
@@ -52,8 +52,7 @@ jobs:
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
- && sudo apt update \
- && sudo apt install gh -y
+ && sudo apt update
sudo apt-get update
sudo apt-get install -y jq gettext
@@ -113,23 +112,7 @@ jobs:
if: github.event_name == 'pull_request'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- DOMAIN="https://pr-${{ github.sha }}-${{ steps.vars.outputs.SERVICE_NAME }}.menlo.ai"
- COMMENT_BODY="🌐 Preview available: [${DOMAIN}](${DOMAIN})"
-
- echo "πŸ” Looking for existing preview comment..."
-
- COMMENT_ID=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
- --jq '.[] | select(.user.login=="github-actions[bot]") | select(.body | contains("<!-- preview-url -->")) | .id')
-
- if [[ -n "$COMMENT_ID" ]]; then
- echo "✏️ Updating existing comment ID $COMMENT_ID"
- gh api repos/${{ github.repository }}/issues/comments/${COMMENT_ID} \
- --method PATCH \
- --field "body=${COMMENT_BODY}"
- else
- echo "πŸ’¬ Creating new comment"
- gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
- --method POST \
- --field "body=${COMMENT_BODY}"
- fi
+ uses: mshick/add-pr-comment@v2
+ with:
+ message: |
+ Preview URL: https://pr-${{ github.sha }}-${{ steps.vars.outputs.SERVICE_NAME }}.menlo.ai
\ No newline at end of file