From 670d636f7b9d3d61e9df7455d5f6561928d573b6 Mon Sep 17 00:00:00 2001 From: Max Levine Date: Fri, 12 Jan 2024 14:28:56 +0000 Subject: [PATCH] feat: Expose includes variable to actions (#392) This PR exposes the includes option to the action --- README.md | 2 +- action.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aef4898c..f18f7e86 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ You can configure `codeowners-generator` from several places: ### CLI options -- **includes** (`--includes`): The glob used to find CODEOWNERS files in the repo `default: ['**/CODEOWNERS', '!CODEOWNERS', '!node_modules']` +- **includes** (`--includes`): The glob used to find CODEOWNERS files in the repo `default: ['**/CODEOWNERS', '!CODEOWNERS', '!.github/CODEOWNERS', '!docs/CODEOWNERS', '!node_modules']` - **output** (`--output`): The output path and name of the file `default: CODEOWNERS` diff --git a/action.yml b/action.yml index 6ba87835..89dc4e3e 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,10 @@ inputs: description: Keep the generated block in the same position it was found in the CODEOWNERS file (if present). Useful for when you make manual additions. required: false default: 'false' + includes: + description: The glob used to find CODEOWNERS files in the repo. Defaults to the value in src/utils/constants.ts + required: false + default: '' version: description: codeowners-generator version. It will default to the latest in npm otherwise' required: false @@ -62,6 +66,10 @@ runs: ARGS_INPUT+=("--preserve-block-position") fi + if [ "${{inputs.includes}}" ]; then + ARGS_INPUT+=("--includes ${{inputs.includes}}") + fi + if [ ! -z "${{inputs.version}}" ]; then VERSION="${{inputs.version}}" fi