From 97f562ab8ec20ccb3de40bda8957519b0124c603 Mon Sep 17 00:00:00 2001 From: sd-katherinekim <62269495+sd-katherinekim@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:11:57 +0900 Subject: [PATCH] Merge docs workflows into single release-triggered pipeline Consolidate notify-docs-update.yml and release-docs-check.yml into a single workflow triggered by release:published events. The separate release-docs-check.yml used pull_request:closed and issue_comment triggers which caused noisy failures on non-release PRs. Changes: - Add docs-validation job to notify-docs-update.yml (triggers claude-docs-validation on client-workflows) - Add workflow_dispatch for manual re-runs - Remove release-docs-check.yml (superseded) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/notify-docs-update.yml | 73 +++++++----- .github/workflows/release-docs-check.yml | 137 ----------------------- 2 files changed, 45 insertions(+), 165 deletions(-) delete mode 100644 .github/workflows/release-docs-check.yml diff --git a/.github/workflows/notify-docs-update.yml b/.github/workflows/notify-docs-update.yml index 2901f627..d6dd7036 100644 --- a/.github/workflows/notify-docs-update.yml +++ b/.github/workflows/notify-docs-update.yml @@ -1,39 +1,60 @@ -# Template: SDK Release Documentation Notification +# SDK Release Documentation Pipeline # -# Copy this workflow to your SDK repository and configure the SDK_TYPE variable. -# When a release is published, it will notify the sendbird-docs repository to -# generate documentation updates based on the release notes. +# When a release is published, this workflow: +# 1. Triggers docs validation (claude-docs-validation) on client-workflows +# 2. Notifies sendbird-docs to generate documentation update PRs # -# Required setup: -# 1. Copy this file to your SDK repo: .github/workflows/notify-docs-update.yml -# 2. Update the SDK_TYPE environment variable to match your SDK -# 3. Create a GitHub Personal Access Token with 'repo' scope -# 4. Add the token as a secret named DOCS_REPO_TOKEN in your SDK repo +# Can also be triggered manually via workflow_dispatch for re-runs. # -# SDK_TYPE options: -# - chat-sdk-javascript -# - chat-sdk-ios -# - chat-sdk-android -# - chat-sdk-flutter -# - chat-sdk-unity -# - uikit-react -# - uikit-react-native -# - uikit-ios -# - uikit-android -# - uikit-swiftui +# Required secrets: +# DOCS_REPO_TOKEN - GitHub token with repo access to sendbird-docs +# SDK_REPO_TOKEN - GitHub token with repo access to client-workflows -name: Notify Docs Repository on Release +name: Release Docs Pipeline on: release: types: [published] + workflow_dispatch: + inputs: + release_tag: + description: 'Release tag (e.g., v3.12.0)' + required: true + type: string env: - # UPDATE THIS: Set to your SDK type (see options above) SDK_TYPE: uikit-react-native + PLATFORM: react-native DOCS_REPO: sendbird/SendBird-Docs jobs: + docs-validation: + runs-on: ubuntu-latest + steps: + - name: Trigger docs validation + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.SDK_REPO_TOKEN }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: 'sendbird', + repo: 'client-workflows', + workflow_id: 'claude-docs-validation.yml', + ref: 'main', + inputs: { + sdk_type: '${{ env.SDK_TYPE }}', + platform: '${{ env.PLATFORM }}', + release_tag: '${{ github.event.release.tag_name || inputs.release_tag }}', + source_repo: '${{ github.repository }}' + } + }); + - name: Summary + run: | + echo "## Docs Validation Triggered" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- **SDK:** ${{ env.SDK_TYPE }}" >> $GITHUB_STEP_SUMMARY + echo "- **Release:** ${{ github.event.release.tag_name || inputs.release_tag }}" >> $GITHUB_STEP_SUMMARY + notify-docs: runs-on: ubuntu-latest steps: @@ -41,9 +62,8 @@ jobs: env: GH_TOKEN: ${{ secrets.DOCS_REPO_TOKEN }} run: | - # Extract repository info SDK_REPO="${{ github.repository }}" - RELEASE_TAG="${{ github.event.release.tag_name }}" + RELEASE_TAG="${{ github.event.release.tag_name || inputs.release_tag }}" RELEASE_URL="${{ github.event.release.html_url }}" echo "Triggering docs update for:" @@ -51,7 +71,6 @@ jobs: echo " Release Tag: $RELEASE_TAG" echo " SDK Type: $SDK_TYPE" - # Trigger repository_dispatch event on docs repo HTTP_STATUS=$(curl -s -o /tmp/dispatch_response.txt -w "%{http_code}" -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $GH_TOKEN" \ @@ -79,8 +98,6 @@ jobs: run: | echo "## Documentation Update Triggered" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "A documentation update request has been sent to the docs repository." >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY echo "- **SDK:** ${{ env.SDK_TYPE }}" >> $GITHUB_STEP_SUMMARY - echo "- **Release:** ${{ github.event.release.tag_name }}" >> $GITHUB_STEP_SUMMARY + echo "- **Release:** ${{ github.event.release.tag_name || inputs.release_tag }}" >> $GITHUB_STEP_SUMMARY echo "- **Docs Repo:** ${{ env.DOCS_REPO }}" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/release-docs-check.yml b/.github/workflows/release-docs-check.yml deleted file mode 100644 index e34c8b0a..00000000 --- a/.github/workflows/release-docs-check.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: Release Docs Check - -on: - pull_request: - types: [closed] - branches: - - main - issue_comment: - types: [created] - workflow_dispatch: - inputs: - release_tag: - description: 'Release tag (e.g., 3.12.0)' - required: false - type: string - default: '' - -# ============================================ -# PLATFORM CONFIG — Change these for your SDK -# ============================================ -env: - SDK_TYPE: uikit-react-native - PLATFORM: react-native - -jobs: - config: - runs-on: ubuntu-latest - outputs: - sdk_type: ${{ steps.set.outputs.sdk_type }} - platform: ${{ steps.set.outputs.platform }} - release_tag: ${{ steps.tag.outputs.release_tag }} - should_run: ${{ steps.tag.outputs.should_run }} - steps: - - id: set - run: | - echo "sdk_type=$SDK_TYPE" >> "$GITHUB_OUTPUT" - echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT" - - id: tag - env: - EVENT_NAME: ${{ github.event_name }} - HEAD_REF: ${{ github.event.pull_request.head.ref }} - MERGED: ${{ github.event.pull_request.merged }} - INPUT_TAG: ${{ inputs.release_tag }} - run: | - if [ "$EVENT_NAME" = "pull_request" ]; then - if [ "$MERGED" = "true" ] && echo "$HEAD_REF" | grep -q "^release/"; then - TAG=$(echo "$HEAD_REF" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | tail -1 || true) - if [ -n "$TAG" ]; then - echo "release_tag=$TAG" >> "$GITHUB_OUTPUT" - echo "should_run=true" >> "$GITHUB_OUTPUT" - else - echo "::warning::Could not extract version from branch '$HEAD_REF'" - echo "should_run=false" >> "$GITHUB_OUTPUT" - fi - else - echo "should_run=false" >> "$GITHUB_OUTPUT" - fi - elif [ "$EVENT_NAME" = "workflow_dispatch" ]; then - echo "release_tag=$INPUT_TAG" >> "$GITHUB_OUTPUT" - echo "should_run=true" >> "$GITHUB_OUTPUT" - fi - - docs-check: - needs: config - if: needs.config.outputs.should_run == 'true' - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.SDK_REPO_TOKEN }} - script: | - await github.rest.actions.createWorkflowDispatch({ - owner: 'sendbird', - repo: 'client-workflows', - workflow_id: 'claude-docs-validation.yml', - ref: 'main', - inputs: { - sdk_type: '${{ needs.config.outputs.sdk_type }}', - platform: '${{ needs.config.outputs.platform }}', - release_tag: '${{ needs.config.outputs.release_tag }}', - source_repo: '${{ github.repository }}' - } - }); - - pr-info: - if: | - github.event_name == 'issue_comment' && - contains(github.event.comment.html_url, '/pull/') && - contains(github.event.comment.body, '/docs-validation') && - github.event.comment.author_association != 'NONE' - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: read - outputs: - release_tag: ${{ steps.extract.outputs.release_tag }} - steps: - - name: Extract release tag from PR branch - id: extract - env: - GH_TOKEN: ${{ github.token }} - PR_NUMBER: ${{ github.event.issue.number }} - run: | - BRANCH=$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json headRefName --jq '.headRefName') - echo "PR branch: $BRANCH" - RELEASE_TAG=$(echo "$BRANCH" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | tail -1 || true) - if [ -z "$RELEASE_TAG" ]; then - echo "::error::PR branch '$BRANCH' does not contain a version number" - exit 1 - fi - echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT" - - docs-check-on-comment: - needs: [config, pr-info] - if: | - github.event_name == 'issue_comment' && - contains(github.event.comment.html_url, '/pull/') && - contains(github.event.comment.body, '/docs-validation') && - github.event.comment.author_association != 'NONE' - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.SDK_REPO_TOKEN }} - script: | - await github.rest.actions.createWorkflowDispatch({ - owner: 'sendbird', - repo: 'client-workflows', - workflow_id: 'claude-docs-validation.yml', - ref: 'main', - inputs: { - sdk_type: '${{ needs.config.outputs.sdk_type }}', - platform: '${{ needs.config.outputs.platform }}', - release_tag: '${{ needs.pr-info.outputs.release_tag }}', - source_repo: '${{ github.repository }}' - } - });