Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to check existence using glob #4

Open
Fleuv opened this issue Jun 25, 2020 · 8 comments
Open

Unable to check existence using glob #4

Fleuv opened this issue Jun 25, 2020 · 8 comments

Comments

@Fleuv
Copy link

Fleuv commented Jun 25, 2020

Unable to check for files existence using the glob character (*).

Steps to reproduce

Use the following job in your github workflow.

...

jobs:
  my_job_id:
    runs-on: ubuntu-latest
    steps:
      - name: Add foo package
        run: mkdir -p package/foo/ && touch package/foo/package.json
      - name: Add bar package
        run: mkdir -p package/bar/ && touch package/bar/package.json
      - name: Check if files exist
        uses: andstor/file-existence-action@v1
        id: check_files
        with:
          files: "packages/*/package.json"
      - name: Result
        if: steps.check_files.outputs.files_exists == 'true'
        run: echo "Files exist"

Expected output:

Files exist

Actual output:

These files doesn't exist: packages/*/package.json
@elizabrock
Copy link

elizabrock commented Jun 30, 2020

This action uses fs.access, which checks for the literal existence of the string that is passed in.

If you want to add glob functionality, I think it would be relatively easy to modify the code to use the glob package instead.

@andstor
Copy link
Owner

andstor commented Jun 30, 2020

Hi 👋

Yes, @elizabrock you are correct. This action does not currently support globs.

However, adding support for globs is something I think would be really useful. The glob package seems to be a great solution.

Is this something you would be interested in implementing @elizabrock ?

@nterbogt
Copy link

I would like to see this functionality also.

@andstor andstor pinned this issue Oct 7, 2020
@joergi
Copy link

joergi commented Oct 12, 2020

@andstor - maybe add the #Hacktoberfest label to get it done?
https://hacktoberfest.digitalocean.com/

@andstor
Copy link
Owner

andstor commented Oct 13, 2020

@andstor - maybe add the #Hacktoberfest label to get it done?

Added 👌

@AraHaan
Copy link

AraHaan commented Jun 22, 2021

instead of using fs and glob why not use the glob-fs package?

artifixer added a commit to BUTR/Bannerlord.ReferenceAssemblies that referenced this issue Aug 4, 2021
Because it does not support glob characters (*).
andstor/file-existence-action#4
@Simonl9l
Copy link

Simonl9l commented Feb 3, 2022

Any word on an enhancement here?

@andstor
Copy link
Owner

andstor commented Feb 25, 2022

Hi 👋

Version v1.1.0 now supports glob patterns 🥳
Feedback is much appreciated 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants