Skip to content

Commit

Permalink
script
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Valdivia Vivar committed Sep 11, 2023
1 parent 7b96535 commit 807410d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/module-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@ jobs:
console.log("${{ steps.changed-files.outputs.all_modified_files }}");
const paths = "${{ steps.changed-files.outputs.all_modified_files }}";
// Use a regular expression to find all occurrences of "/modules/.../..." or "modules/.../..."
const regex = /(?:\/)?modules\/([^/]+)\/[^/]+/g;
const regex = /\/modules\/([^/]+)/g;
const matches = paths.match(regex);
if (!matches) {
return [];
}
// Remove duplicates and extract the module paths
const uniqueModulePaths = Array.from(new Set(matches)).map(match => {
return match.replace(/^\/?modules\//, '');
// Extract the module paths from the matches
const modulePaths = matches.map(match => {
return match.replace('/modules/', '');
});
return modulePaths;
console.log(uniqueModulePaths);
return uniqueModulePaths;
Expand Down

0 comments on commit 807410d

Please sign in to comment.