docs-util: fix release scripts (#6353)

- Fix GitHub action to run on push and check if the commit message is "chore: Release". Only then are TSDocs generated and a PR is opened.
- Add an option to pass to the `run:release` method of the docblock generator a release tag. This is helpful in cases when the GitHub action fails for any reason.
- Add scripts that checks the message of a commit.
This commit is contained in:
Shahed Nasser
2024-02-08 22:36:27 +02:00
committed by GitHub
parent ef64f3740d
commit 66e8f4e0d2
7 changed files with 88 additions and 9 deletions

View File

@@ -4,12 +4,18 @@ import DocblockGenerator from "../classes/docblock-generator.js"
import getMonorepoRoot from "../utils/get-monorepo-root.js"
import { GitManager } from "../classes/git-manager.js"
export default async function () {
type Options = {
tag?: string
}
export default async function ({ tag }: Options) {
const gitManager = new GitManager()
console.log("Get files in commits since last release")
console.log(`Get files in commits since ${tag || "last release"}`)
const files = await gitManager.getCommitFilesSinceLastRelease()
const files = tag
? await gitManager.getCommitFilesSinceRelease(tag)
: await gitManager.getCommitFilesSinceLastRelease()
// filter changed files
let filteredFiles = filterFiles(files)