Skip to content

hashFiles does not follow docs #4049

@y-nk

Description

@y-nk

Describe the bug
As per the docs:

image

internal code of @actions/glob mentions that patterns can be splitted by \n

https://github.com/actions/toolkit/blob/6dd369c0e648ed58d0ead326cf2426906ea86401/packages/glob/src/glob.ts#L11

To Reproduce

on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: touch file.ts file.tsx
      - run: echo ${{ hashFiles('file.ts\nfile.tsx') }} # empty output
      - run: echo ${{ hashFiles('file.ts', 'file.tsx') }} # correct hash

Expected behavior
it should be possible to pass a string with \n delimiters (or even better an array) so that we can feed a fromJson() or a join(fromJson()) expression

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions