GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add glob option to ignore hidden files by joshmgross · Pull Request #1791 · actions/toolkit

Conversation

@joshmgross

@joshmgross joshmgross commented Aug 15, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR adds an option to the glob package to exclude hidden files. This includes:

  1. Any directory starting with .
  2. Any file starting with .
  3. Any files within a directory starting with .

This currently does not check for the hidden attribute that can be set on Windows files. Based on the discussion in nodejs/node#38809, this isn't natively supported in Node at the moment.
I'm open to working around that limitation, but the primary focus here is for files and directories that use the . naming convention.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@joshmgross
Add glob option to ignore hidden files
712ce1b
reemasardana
reemasardana reviewed Aug 15, 2024
View reviewed changes
Comment thread packages/glob/src/internal-glob-options.ts
/**
* Indicates whether to include hidden files (files and directories starting with a `.`).
*
* @default false

@reemasardana reemasardana Aug 15, 2024

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want the default behavior to be to exclude?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@joshmgross joshmgross Aug 15, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want the default to be exclude for the action that consumes this library, I don't think we need or should make a breaking change in this library.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

reemasardana, konradpabjan, and thboop reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

@reemasardana reemasardana Aug 15, 2024

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense for changes to the glob package to be backward compatible but just curious, what other actions use this package? Are there any actions other than upload-artifact where we would want to pass true?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joshmgross reacted with eyes emoji
All reactions
  • 👀 1 reaction

@reemasardana reemasardana Aug 15, 2024

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the comment should read "Indicates whether to exclude hidden files.."

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joshmgross reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@joshmgross joshmgross Aug 15, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any actions other than upload-artifact where we would want to pass true?

https://github.com/actions/toolkit/network/dependents?owner=actions&dependent_type=REPOSITORY&owner=actions

I see actions/deploy-pages, actions/upload-artifact, and actions/download-artifact.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
reemasardana
reemasardana reviewed Aug 15, 2024
View reviewed changes
Comment thread packages/glob/src/internal-globber.ts
continue
}

// Hidden file or directory?

@reemasardana reemasardana Aug 15, 2024

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What upload-artifact version(s) is this code path exercised in?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SrRyan SrRyan Aug 15, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glob is utilized here https://github.com/actions/upload-artifact/blob/main/src/shared/search.ts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
joshmgross added 3 commits August 15, 2024 15:12
@joshmgross
Use the basename of the file/directory to check for .
b617c28
@joshmgross
Ensure the excludeHiddenFiles is properly copied
f8283b9
@joshmgross
Allow the root directory to be matched
ea32451
@joshmgross
joshmgross marked this pull request as ready for review August 15, 2024 19:33
@joshmgross
joshmgross requested a review from a team as a code owner August 15, 2024 19:33
SrRyan
SrRyan reviewed Aug 15, 2024
View reviewed changes
Comment thread packages/glob/src/internal-glob-options-helper.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@joshmgross
Fix description of excludeHiddenFiles
c044e59
@joshmgross joshmgross mentioned this pull request Aug 15, 2024
Exclude hidden files by default actions/upload-artifact#598
Merged
joshmgross added 2 commits August 15, 2024 16:53
@joshmgross
Document Windows hidden attribute limitation
09f6d49
@joshmgross
Bump version
58078a5
thboop
thboop reviewed Aug 15, 2024
View reviewed changes
Comment thread packages/glob/package.json
@@ -1,6 +1,6 @@
{
"name": "@actions/glob",
"version": "0.4.0",

@thboop thboop Aug 15, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the releases file if you are going to bump in this pr as well
https://github.com/actions/toolkit/blob/main/packages/glob/RELEASES.md

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joshmgross reacted with eyes emoji
All reactions
  • 👀 1 reaction

@thboop thboop Aug 15, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No other changes outside of this, some test fixes, and package bumps for security reasons
https://github.com/actions/toolkit/commits/main/packages/glob

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joshmgross reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
joshmgross added 3 commits August 15, 2024 17:01
@joshmgross
lint
a710e01
@joshmgross
Document 0.5.0 release
0034a44
@joshmgross
Lint again
48b2e33
thboop
thboop approved these changes Aug 15, 2024
View reviewed changes

@thboop thboop left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joshmgross reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@joshmgross
joshmgross merged commit 50f2977 into main Aug 15, 2024
@joshmgross
joshmgross deleted the joshmgross/glob-ignore-hidden-files branch August 15, 2024 21:13
ramblingenzyme
ramblingenzyme reviewed Oct 1, 2024
View reviewed changes
Comment thread packages/glob/__tests__/internal-globber.test.ts
await createHiddenDirectory(path.join(root, '.emptyFolder'))
await createHiddenDirectory(path.join(root, '.folder'))
await createHiddenFile(path.join(root, '.file'), 'test .file content')
await fs.writeFile(

@ramblingenzyme ramblingenzyme Oct 1, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused about the behaviour here.

I'm not sure if the behaviour for the following globs matches what's intended

  • ignores-hidden-files/.folder - returns nothing
  • ignores-hidden-files/.folder/ - returns nothing
  • ignores-hidden-files/.folder/* - returns file
  • ignores-hidden-files/.folder/file - returns file

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderabbitai coderabbitai Bot mentioned this pull request Aug 3, 2026
fix(site): avoid Markdown route conflicts in Surge previews ant-design/ant-design#58880
Merged
1 of 17 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Sep 18, 2026
ci: move all retained wheel handoffs to Artifactory ai-dynamo/aisim#199
Merged
Derrick-MUGISHA pushed a commit to Derrick-MUGISHA/toolkit that referenced this pull request Oct 12, 2026
@joshmgross
Add glob option to ignore hidden files (actions#1791)
193ea34
* Add glob option to ignore hidden files

* Use the basename of the file/directory to check for `.`

* Ensure the `excludeHiddenFiles` is properly copied

* Allow the root directory to be matched

* Fix description of `excludeHiddenFiles`

* Document Windows hidden attribute limitation

* Bump version

* `lint`

* Document 0.5.0 release

* Lint again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@SrRyan SrRyan SrRyan left review comments
@thboop thboop thboop approved these changes
+2 more reviewers
@ramblingenzyme ramblingenzyme ramblingenzyme left review comments
@reemasardana reemasardana reemasardana left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@joshmgross @ramblingenzyme @SrRyan @reemasardana @thboop
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.