Skip to content

Update post-process.js #23

Update post-process.js

Update post-process.js #23

name: Build TypeScript docs
on:
workflow_dispatch:
push:
paths:
- 'config/**' # Only run this workflow whenever a file in ./config has changed.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Clone rushstack fork
run: git clone https://github.com/joethei/rushstack.git
- name: Install Rush
run: npm install -g @microsoft/rush
- name: Build Rushstack
working-directory: ./rushstack
continue-on-error: true
run: |
rush update --bypass-policy
rush build
- name: Run API Extractor
run: |
cd config
../rushstack/apps/api-extractor/bin/api-extractor run --local --verbose
- name: Pre-Process API Extractor output
working-directory: ./config
run: node pre-process.js
- name: Generate API docs
working-directory: ./config
run: ../rushstack/apps/api-documenter/bin/api-documenter markdown --output ../en/Reference/TypeScript\ API
- name: Post-process Markdown
working-directory: ./config
run: node post-process.js
- name: Print changes
run: git diff
- name: Configure Git user
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Commit and push changes
run: |
git checkout -b $GITHUB_RUN_ID
git add en/Reference
git commit -m "Auto-generate docs for obsidian.d.ts"
git push -u origin $GITHUB_RUN_ID
- name: Create pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--title "Auto-generate docs for obsidian.d.ts" \
--body "This PR has been automatically created by GitHub Actions." \
--base main \
--head $GITHUB_RUN_ID