actions / actions/runner

hashFiles does not follow docs

Open
#4,049 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the workflow in the issue and compare the documented hashFiles behavior with the linked @actions/glob entry point in packages/glob/src/glob.ts. Reproduce the newline-delimited and separate-argument cases, then trace the hashFiles path to identify where the documented input format diverges. Done means the documented delimiter behavior, or the agreed array behavior, works and is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, javascript
Domain
ci-cd, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.