@@ -22,7 +22,7 @@ inputs:
22
22
default : " ."
23
23
version :
24
24
description : >
25
- Sourcery CLI version, e.g. '1.0.3 '. If empty, default to the latest version
25
+ Sourcery CLI version, e.g. '1.5.0 '. If empty, default to the latest version
26
26
available.
27
27
required : false
28
28
default : " "
@@ -35,10 +35,17 @@ inputs:
35
35
description : " Fail job if issues are found. Either 'true' or 'false'."
36
36
required : false
37
37
default : " true"
38
+ fix :
39
+ description : " Automatically fix issues where possible. Either 'true' or 'false'."
40
+ required : false
41
+ default : " false"
38
42
in_place :
39
43
description : " Change files in place. Either 'true' or 'false'."
40
44
required : false
41
45
default : " false"
46
+ deprecationMessage : >
47
+ This input is deprecated and will be removed in a future release. Please update
48
+ your Sourcery `version` and use `fix` instead of `in_place`.
42
49
config :
43
50
description : " Location of the Sourcery YAML configuration file."
44
51
required : false
82
89
exit 1
83
90
fi
84
91
92
+ if [ ${{ inputs.fix }} == "true" ]; then
93
+ SOURCERY_OPTIONS+=( "--fix" )
94
+ elif [ ${{ inputs.fix }} != "false" ]; then
95
+ echo "Invalid value for input 'fix'"
96
+ echo "Expected either 'true' or 'false'"
97
+ echo "Got '${{ inputs.fix }}'"
98
+ exit 1
99
+ fi
100
+
101
+ # this input is deprecated and will be removed in a future release
102
+ # we are keeping it here because users might have pinned Sourcery to an older
103
+ # version that does not support `--fix`
85
104
if [ ${{ inputs.in_place }} == "true" ]; then
86
105
SOURCERY_OPTIONS+=( "--in-place" )
87
106
elif [ ${{ inputs.in_place }} != "false" ]; then
0 commit comments