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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user