Skip to content

Commit f5f79df

Browse files
Merge pull request #1415 from sendbird/feat/merge-docs-workflows
Merge docs-validation into release docs workflow
2 parents 835ac89 + afbaa21 commit f5f79df

1 file changed

Lines changed: 45 additions & 28 deletions

File tree

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,76 @@
1-
# Template: SDK Release Documentation Notification
1+
# SDK Release Documentation Pipeline
22
#
3-
# Copy this workflow to your SDK repository and configure the SDK_TYPE variable.
4-
# When a release is published, it will notify the sendbird-docs repository to
5-
# generate documentation updates based on the release notes.
3+
# When a release is published, this workflow:
4+
# 1. Triggers docs validation (claude-docs-validation) on client-workflows
5+
# 2. Notifies sendbird-docs to generate documentation update PRs
66
#
7-
# Required setup:
8-
# 1. Copy this file to your SDK repo: .github/workflows/notify-docs-update.yml
9-
# 2. Update the SDK_TYPE environment variable to match your SDK
10-
# 3. Create a GitHub Personal Access Token with 'repo' scope
11-
# 4. Add the token as a secret named DOCS_REPO_TOKEN in your SDK repo
7+
# Can also be triggered manually via workflow_dispatch for re-runs.
128
#
13-
# SDK_TYPE options:
14-
# - chat-sdk-javascript
15-
# - chat-sdk-ios
16-
# - chat-sdk-android
17-
# - chat-sdk-flutter
18-
# - chat-sdk-unity
19-
# - uikit-react
20-
# - uikit-react-native
21-
# - uikit-ios
22-
# - uikit-android
23-
# - uikit-swiftui
9+
# Required secrets:
10+
# DOCS_REPO_TOKEN - GitHub token with repo access to sendbird-docs
11+
# SDK_REPO_TOKEN - GitHub token with repo access to client-workflows
2412

25-
name: Notify Docs Repository on Release
13+
name: Release Docs Pipeline
2614

2715
on:
2816
release:
2917
types: [published]
18+
workflow_dispatch:
19+
inputs:
20+
release_tag:
21+
description: 'Release tag (e.g., v3.17.0)'
22+
required: true
23+
type: string
3024

3125
env:
32-
# UPDATE THIS: Set to your SDK type (see options above)
3326
SDK_TYPE: uikit-react
27+
PLATFORM: react
3428
DOCS_REPO: sendbird/sendbird-docs
3529

3630
jobs:
31+
docs-validation:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Trigger docs validation
35+
uses: actions/github-script@v7
36+
with:
37+
github-token: ${{ secrets.SDK_REPO_TOKEN }}
38+
script: |
39+
await github.rest.actions.createWorkflowDispatch({
40+
owner: 'sendbird',
41+
repo: 'client-workflows',
42+
workflow_id: 'claude-docs-validation.yml',
43+
ref: 'main',
44+
inputs: {
45+
sdk_type: '${{ env.SDK_TYPE }}',
46+
platform: '${{ env.PLATFORM }}',
47+
release_tag: '${{ github.event.release.tag_name || inputs.release_tag }}',
48+
source_repo: '${{ github.repository }}'
49+
}
50+
});
51+
- name: Summary
52+
run: |
53+
echo "## Docs Validation Triggered" >> $GITHUB_STEP_SUMMARY
54+
echo "" >> $GITHUB_STEP_SUMMARY
55+
echo "- **SDK:** ${{ env.SDK_TYPE }}" >> $GITHUB_STEP_SUMMARY
56+
echo "- **Release:** ${{ github.event.release.tag_name || inputs.release_tag }}" >> $GITHUB_STEP_SUMMARY
57+
3758
notify-docs:
3859
runs-on: ubuntu-latest
3960
steps:
4061
- name: Trigger documentation update
4162
env:
4263
GH_TOKEN: ${{ secrets.DOCS_REPO_TOKEN }}
4364
run: |
44-
# Extract repository info
4565
SDK_REPO="${{ github.repository }}"
46-
RELEASE_TAG="${{ github.event.release.tag_name }}"
66+
RELEASE_TAG="${{ github.event.release.tag_name || inputs.release_tag }}"
4767
RELEASE_URL="${{ github.event.release.html_url }}"
4868
4969
echo "Triggering docs update for:"
5070
echo " SDK Repo: $SDK_REPO"
5171
echo " Release Tag: $RELEASE_TAG"
5272
echo " SDK Type: $SDK_TYPE"
5373
54-
# Trigger repository_dispatch event on docs repo
5574
curl -X POST \
5675
-H "Accept: application/vnd.github+json" \
5776
-H "Authorization: Bearer $GH_TOKEN" \
@@ -73,8 +92,6 @@ jobs:
7392
run: |
7493
echo "## Documentation Update Triggered" >> $GITHUB_STEP_SUMMARY
7594
echo "" >> $GITHUB_STEP_SUMMARY
76-
echo "A documentation update request has been sent to the docs repository." >> $GITHUB_STEP_SUMMARY
77-
echo "" >> $GITHUB_STEP_SUMMARY
7895
echo "- **SDK:** ${{ env.SDK_TYPE }}" >> $GITHUB_STEP_SUMMARY
79-
echo "- **Release:** ${{ github.event.release.tag_name }}" >> $GITHUB_STEP_SUMMARY
96+
echo "- **Release:** ${{ github.event.release.tag_name || inputs.release_tag }}" >> $GITHUB_STEP_SUMMARY
8097
echo "- **Docs Repo:** ${{ env.DOCS_REPO }}" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)