Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add generated_by to input to specify the generator #2

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading