docs: change process for generating docblocks through actions (#6237)

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>
This commit is contained in:
Shahed Nasser
2024-01-29 10:05:14 +02:00
committed by GitHub
parent 8f9a12c895
commit 96629f1916
10 changed files with 698 additions and 119 deletions

View File

@@ -37,44 +37,4 @@ jobs:
- name: Create Release Pull Request
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tsdoc-pr:
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: Build packages
run: yarn build
- 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:commit ${{ github.sha }}"
working-directory: docs-util/packages/docblock-generator
- 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/**
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}