Skip to content

Commit

Permalink
feat: Add generated_by to input to specify the generator
Browse files Browse the repository at this point in the history
  • Loading branch information
meriy100 committed Dec 10, 2024
1 parent 60e6b84 commit 71477c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'`

Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 ./...
Expand Down

0 comments on commit 71477c5

Please sign in to comment.