Skip to content

Commit

Permalink
[ADD] updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sunil-samtani committed Oct 28, 2020
1 parent 5671558 commit 3c6ed0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ inputs:
regex_pattern:
description: "regex pattern"
required: true
regex_flags:
description: "regex flag"
required: true
search_string:
description: "search string"
required: true
Expand Down
7 changes: 2 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ const core = require('@actions/core');

try {
let regexPattern = core.getInput('regex_pattern');
let regexFlags = core.getInput('regex_flags');
let regexFlags = ''
let searchString = core.getInput('search_string');
if (!regexPattern) {
core.setFailed('regex_pattern input is required');
return;
}
if (!regexFlags) {
regexFlags = '';
return;
}
if (!searchString) {
core.setFailed('search_string input is required');
return;
Expand All @@ -24,6 +20,7 @@ try {
}
console.log('Found:', matches);
console.log('set output "first_match":', matches[0]);
console.log('set output "match_grp":', matches[1]);
core.setOutput('first_match', matches[0]);
core.setOutput('match_grp', matches[1]);
} catch (error) {
Expand Down

0 comments on commit 3c6ed0a

Please sign in to comment.