From 677ff927a40382a2c1ab9f596d27de32f1e36d54 Mon Sep 17 00:00:00 2001 From: Viktor Kuroljov Date: Mon, 13 Jul 2020 14:09:17 +0300 Subject: [PATCH] docs(readme): Path can be relative or absolute for pre-commit input --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2adb4ec..c02b018 100644 --- a/README.md +++ b/README.md @@ -26,14 +26,13 @@ This action will bump version, tag commit and generate a changelog with conventi > version is already known and a new changelog has been generated. You can run any chores across your > repository that should be added and commited with the release commit. -An absolute path to the `.js` script file must be provided when specifying the `pre-commit` hook. File -should contain all its dependencies bundled in itself just like for the webapp. +Specified path could be relative or absolute. If it is relative, then it will be based on the `GITHUB_WORKSPACE` path. Script should: - be a CommonJS module - have a single export: `exports.preCommit = (props) => { /* ... */ }` - not have any return value -- be bundled +- be bundled (contain all dependencies in itself, just like the bundled webapp) `preCommit` function can be `async`. @@ -41,7 +40,6 @@ Following props will be passed to the function as a single parameter: ```typescript interface Props { - workspace: string; // same as process.env.GITHUB_WORKSPACE tag: string; // Next tag e.g. v1.12.3 version: string; // Next version e.g. 1.12.3 } @@ -49,6 +47,8 @@ interface Props { export function preCommit(props: Props): void {} ``` +A bunch of useful environment variables are available to the script with `process.env`. See [docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables](https://docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables) to learn more. + ## Outputs - `changelog`: The generated changelog for the new version. @@ -126,7 +126,7 @@ Use a pre-commit hook uses: TriPSs/conventional-changelog-action@v3 with: github-token: ${{ secrets.github_token }} - pre-commit: ${{ github.workspace }}/some/path/pre-commit.js # requires absolute path + pre-commit: some/path/pre-commit.js ``` Github releases