From 917724b6a4eda18d68c2f08f1d504a1b308e286a Mon Sep 17 00:00:00 2001 From: fern-bot Date: Fri, 29 Nov 2024 10:41:24 -0500 Subject: [PATCH 1/5] single preview comment --- .github/workflows/preview-docs.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 94ea44ac0ae..313eb2cb9f0 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -40,8 +40,24 @@ jobs: echo "Preview URL: $URL" echo "🌿 Preview your docs: $URL" > preview_url.txt - - name: Comment URL in PR - uses: thollander/actions-comment-pull-request@v2.4.3 - with: - filePath: preview_url.txt - comment_tag: docs-preview-link + - name: Comment or Update URL in PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + COMMENT_TAG="" + PREVIEW_URL=$(cat preview_url.txt) + + # Get existing comments + EXISTING_COMMENT=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ + --jq ".[] | select(.body | contains(\"${COMMENT_TAG}\")) | .id") + + if [ -z "$EXISTING_COMMENT" ]; then + # No existing comment, create one + gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ + -f body="${COMMENT_TAG}\n🌿 Preview your docs: $PREVIEW_URL" + else + # Update existing comment + gh api repos/${{ github.repository }}/issues/comments/$EXISTING_COMMENT \ + -X PATCH \ + -f body="${COMMENT_TAG}\n🌿 Preview your docs: $PREVIEW_URL" + fi From 856601e660434f2cf978d66148dfd46304b71770 Mon Sep 17 00:00:00 2001 From: fern-bot Date: Fri, 29 Nov 2024 10:44:29 -0500 Subject: [PATCH 2/5] DO NOT MERGE: testing --- fern/pages/docs/building-your-docs/announcement-banner.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fern/pages/docs/building-your-docs/announcement-banner.mdx b/fern/pages/docs/building-your-docs/announcement-banner.mdx index d43b20f89c2..5d5e5b5ea5e 100644 --- a/fern/pages/docs/building-your-docs/announcement-banner.mdx +++ b/fern/pages/docs/building-your-docs/announcement-banner.mdx @@ -4,6 +4,8 @@ subtitle: Prominently highlight new features, updates, or important information slug: /docs/building-your-docs/announcements --- +Testing a small change. + An announcement banner is a great way to draw attention to new features and product launches. When configured, the announcement bar appears at the top of your docs site. After the user dismisses the bar, it will reappear the next time you update the announcement. ```yaml docs.yml From b70622b9f260ac5d0828b15bfd1e954b0141a670 Mon Sep 17 00:00:00 2001 From: fern-bot Date: Fri, 29 Nov 2024 10:51:09 -0500 Subject: [PATCH 3/5] another update --- fern/pages/docs/building-your-docs/announcement-banner.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/fern/pages/docs/building-your-docs/announcement-banner.mdx b/fern/pages/docs/building-your-docs/announcement-banner.mdx index 5d5e5b5ea5e..d43b20f89c2 100644 --- a/fern/pages/docs/building-your-docs/announcement-banner.mdx +++ b/fern/pages/docs/building-your-docs/announcement-banner.mdx @@ -4,8 +4,6 @@ subtitle: Prominently highlight new features, updates, or important information slug: /docs/building-your-docs/announcements --- -Testing a small change. - An announcement banner is a great way to draw attention to new features and product launches. When configured, the announcement bar appears at the top of your docs site. After the user dismisses the bar, it will reappear the next time you update the announcement. ```yaml docs.yml From 5263808a327bd5a70daa189fc8410dc76a63d508 Mon Sep 17 00:00:00 2001 From: fern-bot Date: Fri, 29 Nov 2024 10:52:37 -0500 Subject: [PATCH 4/5] TESTING --- fern/pages/docs/building-your-docs/announcement-banner.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fern/pages/docs/building-your-docs/announcement-banner.mdx b/fern/pages/docs/building-your-docs/announcement-banner.mdx index d43b20f89c2..a6c5f9acb1b 100644 --- a/fern/pages/docs/building-your-docs/announcement-banner.mdx +++ b/fern/pages/docs/building-your-docs/announcement-banner.mdx @@ -12,3 +12,5 @@ announcement: ``` Markdown and HTML is supported in the announcement message. You can include links, images, and other formatting. [Custom css](/learn/docs/building-your-docs/custom-css-global-js#custom-css) can be used to customize the style of the announcement. + +Another docs change \ No newline at end of file From a050bf3c2ec83370388ccbac5859a49cd44eeb47 Mon Sep 17 00:00:00 2001 From: fern-bot Date: Fri, 29 Nov 2024 12:04:27 -0500 Subject: [PATCH 5/5] check for cli changes --- .github/workflows/preview-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index ad2352f87e2..656d82cae03 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -6,6 +6,7 @@ on: - main paths: - 'fern/**' + - 'packages/cli/docs-*' workflow_dispatch: inputs: prNumber: