This PR changes the original process of generating docblocks through actions. The process now is: 1. When a PR is merged for the branch `changeset-release/develop`, the docblock generator tool us used to generate docblocks for the changed files. The changed files are determined by retrieving all comments since the last release and the files in each of those commits. 2. If there are changes after using the docblock generator tool, a PR is opened in the branch `chore/generate-tsdocs`. 3. Once the `chore/generate-tsdocs` is merged, it triggers an action that generates the references for the docs. This changes the previous behaviour of generating references on a new release. Both actions (that runs the docblock generator tool and that generates references for the docs) can also be triggered manually. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: Generate Docblocks [Automated]
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- develop
|
|
types:
|
|
- closed
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
generate:
|
|
if: github.event_name == 'workflow_dispatch' || (startsWith(github.head_ref, 'changeset-release/develop') && github.event.pull_request.merged == true)
|
|
name: Generated TSDoc PRs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js 18
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
|
|
- name: Install Dependencies
|
|
run: yarn
|
|
|
|
- name: Install docs-util Dependencies
|
|
run: yarn
|
|
working-directory: docs-util
|
|
|
|
- name: Build packages
|
|
run: yarn build
|
|
working-directory: docs-util
|
|
|
|
- name: Run docblock generator
|
|
run: "yarn start run:release"
|
|
working-directory: docs-util/packages/docblock-generator
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GIT_OWNER: ${{ github.repository_owner }}
|
|
GIT_REPO: medusa
|
|
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
title: "Generated TSDocs"
|
|
body: "This PR holds all generated TSDocs for the upcoming release."
|
|
branch: "chore/generate-tsdocs"
|
|
team-reviewers: "@medusajs/docs"
|
|
add-paths: packages/** |