Fix typo #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will update the docs in the sdk-docs repo | |
name: Update Docs | |
on: | |
push: | |
branches: | |
- generate-docs | |
jobs: | |
update-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Setup Yarn | |
run: | | |
corepack enable | |
corepack prepare yarn@4.5.0 --activate | |
- name: Install dependencies | |
run: yarn install | |
- name: Run gen:docs command | |
run: yarn gen:docs | |
- name: Check and commit changes | |
id: commit_check | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "actions@github.com" | |
if [[ -n "$(git status --porcelain docs)" ]]; then | |
git add docs | |
git commit -m "[ci:bot] Update docs" | |
echo "has_changes=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "has_changes=false" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Push the changes | |
if: steps.commit_check.outputs.has_changes == 'true' | |
run: git push | |
- name: Install dependencies | |
if: steps.commit_check.outputs.has_changes == 'true' | |
run: yarn add simple-git | |
- name: Setup GitHub CLI | |
if: steps.commit_check.outputs.has_changes == 'true' | |
run: | | |
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" | |
- name: Update docs | |
if: steps.commit_check.outputs.has_changes == 'true' | |
env: | |
PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | |
run: node ./.github/ci-scripts/update-sdk-docs.cjs |