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

Feature Request: any file mode #132

Open
cardil opened this issue Jan 30, 2023 · 0 comments
Open

Feature Request: any file mode #132

cardil opened this issue Jan 30, 2023 · 0 comments

Comments

@cardil
Copy link

cardil commented Jan 30, 2023

Hi,

I'd like to propose a feature. To add a any == false flag to the action. If set to true, the action will return true, if any of the listed globs matches, as opposed to the default setting where all files must exist.

This feature will greatly simplify a common case, where we'd like to check the existence of any of the listed files:

- id: golang-sources
  uses: andstor/file-existence-action@v2
  with:
    files: go.mod, go.work
    any: true

- name: Build Go sources
  if: ${{ steps.golang-sources.outputs.files_exists == 'true' }}
  run: |
    go build ./...

instead of:

- id: gomod
  uses: andstor/file-existence-action@v2
  with:
    files: go.mod

- id: gowork
  uses: andstor/file-existence-action@v2
  with:
    files: go.work

- name: Build Go sources
  if: ${{ steps.gomod.outputs.files_exists == 'true' || steps.gowork.outputs.files_exists == 'true' }}
  run: |
    go build ./...
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

1 participant