Skip to content

Commit

Permalink
Merge pull request #10 from betrybe/learn-6298
Browse files Browse the repository at this point in the history
fix: desconsidera arquivo dentro da pasta .github
  • Loading branch information
AdrielBento authored Aug 15, 2022
2 parents 354bc4f + 48c4025 commit 567e6b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ steps:
with:
node-version: '12'
- name: Static code analysis step
uses: betrybe/eslint-linter-action@v2
uses: betrybe/eslint-linter-action@v3.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
pr_number: ${{ github.event.inputs.pr_number }}
Expand All @@ -80,7 +80,7 @@ steps:
with:
node-version: '12'
- name: Static code analysis step
uses: betrybe/eslint-linter-action@v2
uses: betrybe/eslint-linter-action@v3.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
pr_number: ${{ github.event.inputs.pr_number }}
Expand Down
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const findFilesBy = (startDirectory, stringSearch) => {
files.forEach((file) => {
const filename = path.join(currentDirectory, file);

if (filename.indexOf('node_modules') !== -1) return;
if (notNodeModulesDirectory(filename) || isActionDirectory(filename)) return;

const stat = fs.lstatSync(filename);

Expand All @@ -143,6 +143,10 @@ const findFilesBy = (startDirectory, stringSearch) => {
return foundFiles;
};

const notNodeModulesDirectory = (filename) => filename.indexOf('node_modules') !== -1;

const isActionDirectory = (filename) => filename.includes('.github/actions');

module.exports = findFilesBy;


Expand Down
6 changes: 5 additions & 1 deletion findFilesBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const findFilesBy = (startDirectory, stringSearch) => {
files.forEach((file) => {
const filename = path.join(currentDirectory, file);

if (filename.indexOf('node_modules') !== -1) return;
if (notNodeModulesDirectory(filename) || isActionDirectory(filename)) return;

const stat = fs.lstatSync(filename);

Expand All @@ -34,4 +34,8 @@ const findFilesBy = (startDirectory, stringSearch) => {
return foundFiles;
};

const notNodeModulesDirectory = (filename) => filename.indexOf('node_modules') !== -1;

const isActionDirectory = (filename) => filename.includes('.github/actions');

module.exports = findFilesBy;

0 comments on commit 567e6b6

Please sign in to comment.