From 71477c5c0ef855b76f4bb64ef389a9fa2e89301f Mon Sep 17 00:00:00 2001 From: meriy100 Date: Tue, 10 Dec 2024 18:10:24 +0900 Subject: [PATCH] feat: Add `generated_by` to input to specify the generator --- README.md | 6 +++++- action.yml | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 983e854..8288202 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ This GitHub Action, named "Validate Go Generate," is designed to help validate a - Description: The commit message to be used if commits are enabled. - Default: `'fix: generate files'` -4. **commit-actor** (default: `'github_actions'`): +4. **generated-by** (default: `.*`) + - Description: Target only the code generated by the specified generator. By default, all generators + - Default: `.*` + +5. **commit-actor** (default: `'github_actions'`): - Description: The actor or user to be associated with the commit. - Default: `'github_actions'` diff --git a/action.yml b/action.yml index e19c5ed..3ba6d8a 100644 --- a/action.yml +++ b/action.yml @@ -4,6 +4,9 @@ inputs: root_path: description: application root path default: ./ + generated-by: + description: Target only the code generated by the specified generator + default: '.*' commit: description: commit default: 'false' @@ -17,7 +20,7 @@ runs: using: composite steps: - name: Remove generated files - run: git grep --name-only -E '^// Code generated by .*. DO NOT EDIT.$' | xargs rm -rf - + run: git grep --name-only -E '^// Code generated by ${{ inputs.generated-by }}. DO NOT EDIT.$' | xargs rm -rf - shell: bash - name: Generate files run: go generate ./...