Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions .github/workflows/release-docs-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Release Docs Check

on:
pull_request:
types: [closed]
branches:
- main
issue_comment:
types: [created]
workflow_dispatch:
Comment on lines +3 to +10
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add workflow_run trigger for the workflow_run code path

The config job includes a full if [ "$EVENT_NAME" = "workflow_run" ] branch to derive release_tag, but this workflow is only triggered by issue_comment and workflow_dispatch. As a result, that release-flow path is dead code and the release-driven docs check cannot run automatically, even though the job logic is written for it. Add an on.workflow_run trigger (or remove the unreachable branch) so the behavior matches the implemented logic.

Useful? React with 👍 / 👎.

inputs:
release_tag:
description: 'Release tag (e.g., 3.17.0)'
required: false
type: string
default: ''

# ============================================
# PLATFORM CONFIG — Change these for your SDK
# ============================================
env:
SDK_TYPE: uikit-react
PLATFORM: react

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 }}'
}
});
Loading