-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove auto commit functionality (#4)
* Remove out-commit functionality * Update README.md
- Loading branch information
1 parent
aecb1b5
commit d376cea
Showing
3 changed files
with
6 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,14 +38,6 @@ Determines whether the action should fail if the code needs to be reformatted. | |
- Default: `no` | ||
- Accepted values: `yes`, `no` | ||
|
||
## `auto_commit` | ||
|
||
Determines whether the action should automatically commit the changes made by the `ReSharper's CleanupCode Command-Line Tool`. | ||
|
||
- Required: `false` | ||
- Default: `yes` | ||
- Accepted values: `yes`, `no` | ||
|
||
## `jb_cleanup_code_arg` | ||
|
||
Additional arguments to pass to the `ReSharper's CleanupCode Command-Line Tool`. Configure the tool with command-line parameters, | ||
|
@@ -57,27 +49,6 @@ e.g.: `--verbosity=INFO --profile=Built-in: Full Cleanup --exclude=**UnitTests/* | |
- Required: `false` | ||
- Default: `--verbosity=WARN` | ||
|
||
## `commit_message` | ||
|
||
The commit message to use if `auto_commit` is set to `yes`. | ||
|
||
- Required: `false` | ||
- Default: `Cleanup code` | ||
|
||
## `commit_creator_email` | ||
|
||
The email address to use for the git user who creates the commit if `auto_commit` is set to `yes`. | ||
|
||
- Required: `false` | ||
- Default: `[email protected]` | ||
|
||
## `commit_creator_name` | ||
|
||
The name to use for the git user who creates the commit if `auto_commit` is set to `yes`. | ||
|
||
- Required: `false` | ||
- Default: `CleanupCode GitHub Action` | ||
|
||
# [ReSharper CLI CleanupCode GitHub Action Demo Usage](https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo) | ||
|
||
In that demo project, you will find all the knowledge you need to effectively start using this action. | ||
|
@@ -99,26 +70,6 @@ steps: | |
solution: 'ReSharperCleanupCodeDemo.sln' | ||
``` | ||
That configuration means that the action does clean up and all cleaned up code will be committed and pushed into remote repo. | ||
Commit will be performed with default commit message, git user email and name. | ||
- default commit message: `Clean up code by ReSharper CLI CleanupCode Tool` | ||
- default git user email: `[email protected]` | ||
- default git user name: `CleanupCode Action` | ||
|
||
## Change commit message, git user email and name | ||
|
||
```yaml | ||
steps: | ||
- name: Cleanup Code | ||
uses: ArturWincenciak/[email protected] | ||
with: | ||
solution: 'ReSharperCleanupCodeDemo.sln' | ||
commit_message: 'Clean up the code' | ||
commit_creator_email: '[email protected]' | ||
commit_creator_name: 'Knuth Conway' | ||
``` | ||
|
||
## Interrupt your CI/CD pipeline if Cleanup detected the code needs to be cleaned up | ||
```yaml | ||
|
@@ -133,7 +84,7 @@ steps: | |
If this setting is enabled, the process will stop and return an error code if it finds that the code needs to be cleaned | ||
up. This can be helpful for stopping the pipeline from continuing if there are problems with the code. | ||
## No interrupt and no clean up | ||
## No interrupt your CI/CD pipeline if Cleanup detected the code needs to be cleaned up | ||
```yaml | ||
steps: | ||
|
@@ -142,18 +93,10 @@ steps: | |
with: | ||
solution: 'ReSharperCleanupCodeDemo.sln' | ||
fail_on_reformat_needed: 'no' | ||
auto_commit: 'no' | ||
``` | ||
At times, you may want to disable automatic clean up code and continue with the execution of your CI/CD pipeline, for | ||
instance, when you need to debug subsequent steps without performing clean up. | ||
|
||
## Interrupt the pipeline vs Clean up code | ||
Note that if you set the action to automatically clean up code (which can be very helpful), you risk encountering the | ||
need to resolve conflicts later if you forget to pull the automatically-committed changes. | ||
For some, interrupting the CI/CD pipeline and performing code cleanup locally in your IDE or by console command | ||
may be a more convenient option. | ||
At times, you may want to disable the interruption and continue with the execution of your CI/CD pipeline, for instance, when you need to debug subsequent steps without performing clean up. | ||
### Perform clean up your code locally with a fully automated commit and save your time | ||
|
@@ -198,11 +141,7 @@ jobs: | |
with: | ||
solution: 'ReSharperCleanupCodeDemo.sln' | ||
fail_on_reformat_needed: 'no' | ||
auto_commit: 'yes' | ||
jb_cleanup_code_arg: '--verbosity=INFO --profile=Built-in: Full Cleanup --exclude=**UnitTests/**.*' | ||
commit_message: 'Cleanup code by ReSharper CLI CleanupCode GitHub Action' | ||
commit_creator_email: '[email protected]' | ||
commit_creator_name: 'Clean Up' | ||
``` | ||
### Sequence of actions performed by the prepared GitHub Action | ||
- `Checkout`: download the source code from the current repository where the Action was | ||
|
@@ -252,15 +191,11 @@ jobs: | |
- name: Cleanup Code | ||
id: cleanup | ||
uses: ArturWincenciak/ReSharper_CleanupCode@v2.0 | ||
uses: ArturWincenciak/ReSharper_CleanupCode@v3.0 | ||
with: | ||
solution: 'ReSharperCleanupCodeDemo.sln' | ||
fail_on_reformat_needed: 'no' | ||
auto_commit: 'yes' | ||
jb_cleanup_code_arg: '--verbosity=INFO --profile=Almost Full Cleanup --exclude=**UnitTests/**.*' | ||
commit_message: 'Cleanup code by ReSharper CLI CleanupCode GitHub Action' | ||
commit_creator_email: '[email protected]' | ||
commit_creator_name: 'CleanupCode Action' | ||
inspection: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,30 +14,14 @@ inputs: | |
description: 'Determines whether the action should fail if the code needs to be reformatted' | ||
required: false | ||
default: 'no' | ||
auto_commit: | ||
description: 'Determines whether the action should automatically commit the changes made by the ReSharpers CleanupCode Command-Line Tool' | ||
required: false | ||
default: 'yes' | ||
jb_cleanup_code_arg: | ||
description: 'Additional arguments to pass to the ReSharpers CleanupCode Command-Line Tool. Configure the tool with command-line parameters e.g. --verbosity=INFO --profile=Built-in: Full Cleanup --exclude=**UnitTests/**.*' | ||
required: false | ||
default: '--verbosity=WARN' | ||
commit_message: | ||
description: 'The commit message to use if auto_commit is set to yes' | ||
required: false | ||
default: "Clean up code by ReSharper CLI CleanupCode Tool" | ||
commit_creator_email: | ||
description: 'The email address to use for the git user who creates the commit if auto_commit is set to yes' | ||
required: false | ||
default: "[email protected]" | ||
commit_creator_name: | ||
description: 'The name to use for the git user who creates the commit if auto_commit is set to yes' | ||
required: false | ||
default: "CleanupCode Action" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Run Script | ||
run: ${GITHUB_ACTION_PATH}/entrypoint.sh "${{ inputs.solution }}" "${{ inputs.fail_on_reformat_needed }}" "${{ inputs.auto_commit }}" "${{ inputs.jb_cleanup_code_arg }}" "${{ inputs.commit_message }}" "${{ inputs.commit_creator_email }}" "${{ inputs.commit_creator_name }}" | ||
run: ${GITHUB_ACTION_PATH}/entrypoint.sh "${{ inputs.solution }}" "${{ inputs.fail_on_reformat_needed }}" "${{ inputs.jb_cleanup_code_arg }}" | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters