From e89aa4dc5a4ec89a681d578493a20ee6606a2f3e Mon Sep 17 00:00:00 2001 From: curquiza Date: Thu, 26 Oct 2023 14:52:15 +0200 Subject: [PATCH 1/3] Add CI to create a comment about preview info when opening a PR --- .github/workflows/preview-info.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/preview-info.yml diff --git a/.github/workflows/preview-info.yml b/.github/workflows/preview-info.yml new file mode 100644 index 0000000000..e2fc9d7432 --- /dev/null +++ b/.github/workflows/preview-info.yml @@ -0,0 +1,27 @@ +name: Show preview on PRs + +on: + pull_request: + types: [opened] + +env: + GH_TOKEN: ${{ secrets.MEILI_BOT_GH_PAT }} + CURRENT_BRANCH: ${{ github.event.pull_request.head.ref }} + +jobs: + preview-info: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Prepare comment content + run: | + echo '## How to see the preview of this PR?' >> comment.txt + echo '' >> comment.txt + echo '⚠️ Accessible for internal Meili people only.' >> comment.txt + echo '' >> comment.txt + echo "Go to this URL: https://website-git-deploy-preview-mei-16-meili.vercel.app/docs/branch%3A$CURRENT_BRANCH" >> comment.txt + echo '' >> comment.txt + echo "Credentials to access the page are in the company\'s password manager as \"Docs deploy preview\"." >> comment.txt + - name: Add comment to PR with preview information + run: | + gh pr comment $CURRENT_BRANCH --body-file comment.txt From 7a2f3ca9f7b702e7eee888cd4d58645831573ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mentine=20U=2E=20-=20curqui?= Date: Mon, 30 Oct 2023 11:55:41 +0100 Subject: [PATCH 2/3] Update .github/workflows/preview-info.yml Co-authored-by: gui machiavelli --- .github/workflows/preview-info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-info.yml b/.github/workflows/preview-info.yml index e2fc9d7432..512b1545e2 100644 --- a/.github/workflows/preview-info.yml +++ b/.github/workflows/preview-info.yml @@ -17,7 +17,7 @@ jobs: run: | echo '## How to see the preview of this PR?' >> comment.txt echo '' >> comment.txt - echo '⚠️ Accessible for internal Meili people only.' >> comment.txt + echo '⚠️ Private link, only accessible to Meilisearch employees.' >> comment.txt echo '' >> comment.txt echo "Go to this URL: https://website-git-deploy-preview-mei-16-meili.vercel.app/docs/branch%3A$CURRENT_BRANCH" >> comment.txt echo '' >> comment.txt From e1c08e840dad3269481f6365ac8923ceb74dd75b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mentine=20U=2E=20-=20curqui?= Date: Mon, 30 Oct 2023 11:56:39 +0100 Subject: [PATCH 3/3] Update .github/workflows/preview-info.yml Co-authored-by: gui machiavelli --- .github/workflows/preview-info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-info.yml b/.github/workflows/preview-info.yml index 512b1545e2..73939e58a5 100644 --- a/.github/workflows/preview-info.yml +++ b/.github/workflows/preview-info.yml @@ -19,7 +19,7 @@ jobs: echo '' >> comment.txt echo '⚠️ Private link, only accessible to Meilisearch employees.' >> comment.txt echo '' >> comment.txt - echo "Go to this URL: https://website-git-deploy-preview-mei-16-meili.vercel.app/docs/branch%3A$CURRENT_BRANCH" >> comment.txt + echo "Go to this URL: https://website-git-deploy-preview-mei-16-meili.vercel.app/docs/branch:$CURRENT_BRANCH" >> comment.txt echo '' >> comment.txt echo "Credentials to access the page are in the company\'s password manager as \"Docs deploy preview\"." >> comment.txt - name: Add comment to PR with preview information