Skip to content

Commit b9434fe

Browse files
committed
Fixed passing arguments
1 parent f1e7af0 commit b9434fe

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

Action/ActionInputs.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,8 @@ public class ActionInputs : IActionInputs
3434
Default = "",
3535
HelpText = "Regex for names of default ResX files whose data should be copied instead of translated.")]
3636
public string DataCopiesRegex { get; set; } = "";
37+
38+
public override string ToString() =>
39+
$"{nameof(ActionInputs)} => {nameof(Directory)}: {Directory}, {nameof(AuthKey)}: {AuthKey}, {nameof(ExcludesRegex)}: {ExcludesRegex}, {nameof(DataCopiesRegex)}: {DataCopiesRegex}";
3740
}
3841
}

Main/Translation/IContext.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ public DeepLContext(
3838
_logger = logger;
3939
_fileInfoFactory = fileInfoFactory;
4040
_directoryInfoFactory = directoryInfoFactory;
41-
41+
42+
if (actionInputs.ToString() is {} message)
43+
_logger.FileLessNotice(message);
4244
_excludesRegex = string.IsNullOrWhiteSpace(actionInputs.ExcludesRegex) ? null : regexFactory(actionInputs.ExcludesRegex);
4345
_dataCopiesRegex = string.IsNullOrWhiteSpace(actionInputs.DataCopiesRegex) ? null : regexFactory(actionInputs.DataCopiesRegex);
4446
}
@@ -81,7 +83,7 @@ bool IsDefaultResxFileName(FileInfo fi)
8183
bool IsNotExcluded(FileInfo defaultResXFile)
8284
{
8385
var ret = !(_excludesRegex?.IsMatch(defaultResXFile.Name) ?? false);
84-
if(ret) _logger.Notice(defaultResXFile, "Default file excluded by regex");
86+
if(!ret) _logger.Notice(defaultResXFile, "Default file excluded by regex");
8587
return ret;
8688
}
8789
}

action.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,19 @@ branding:
66
inputs:
77
dir:
88
description: 'The root directory to work from. Example, "path/to/code".'
9-
required: true
9+
required: false
10+
default: '.'
1011
auth:
1112
description: 'Auth key for your DeepL API access.'
1213
required: true
14+
excludes-regex:
15+
description: 'Regex for names of default ResX files in order to decide whether to exclude file from processing.'
16+
required: false
17+
default: ''
18+
data-copies-regex:
19+
description: 'Regex for names of default ResX files whose data should be copied instead of translated.'
20+
required: false
21+
default: ''
1322
outputs:
1423
summary-title:
1524
description: 'The title of the commit for the pull request.'
@@ -23,3 +32,7 @@ runs:
2332
- ${{ inputs.dir }}
2433
- '-a'
2534
- ${{ inputs.auth }}
35+
- '-e'
36+
- ${{ inputs.excludes-regex }}
37+
- '-c'
38+
- ${{ inputs.data-copies-regex }}

0 commit comments

Comments
 (0)