Skip to content

Feature Request: any file mode #132

@cardil

Description

@cardil

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 ./...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions