Skip to content

Commit

Permalink
feat: add support for optionally reading the gitignore file
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed May 4, 2024
1 parent 674bbad commit f3d30c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ inputs:
description: 'Indicates whether to match files in `.gitignore`'
default: "false"
required: true
read-gitignore:
description: 'Indicates whether to read `.gitignore`. If set to `false`, the `.gitignore` file will be ignored. Overrides `match-gitignore-files`'
default: "true"
required: true
separator:
description: 'Separator used for the paths output.'
required: true
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export async function run(): Promise<void> {
const matchGitignoreFiles = core.getBooleanInput('match-gitignore-files', {
required: true
})
const readGitignore = core.getBooleanInput('read-gitignore', {required: true})
const separator = core.getInput('separator', {
required: true,
trimWhitespace: false
Expand Down Expand Up @@ -202,7 +203,7 @@ export async function run(): Promise<void> {
})
let paths = new Set(await globber.glob())

if (await exists(gitignorePath)) {
if (readGitignore && await exists(gitignorePath)) {
const gitignoreFilePatterns = (
await getFilesFromSourceFile({
filePaths: [gitignorePath]
Expand Down

0 comments on commit f3d30c1

Please sign in to comment.