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

hashFiles() cannot be correctly used with github.action_path in composite actions #3765

Open
sybereal opened this issue Mar 24, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@sybereal
Copy link

Describe the bug

hashFiles() does not permit . and .. segments in its arguments. However, when using a composite action from the same repository, github.action_path contains a trailing /./, as the argument to uses has to begin with . to be recognized as a path.

To Reproduce
Steps to reproduce the behavior:

  1. In a blank repo, create a composite action at .github/actions/foo that invokes hashFiles(format('{0}/bar.txt', github.action_path)).
  2. Use that action in a workflow via uses: ./.github/actions/foo and trigger the workflow.
  3. See error

Expected behavior
It should be possible to use hashFiles() with github.action_path in a composite action. It shouldn't be necessary to have a separate Bash step that only exists to trim the last two characters off the end of the path.

Runner Version and Platform

Version of your runner? 2.322.0

OS of the machine running the runner? Ubuntu 24.0.2 LTS

What's not working?

##[debug]AssertionError [ERR_ASSERTION]: Invalid pattern '/home/runner/work/<repo>/./.github/actions/foo/bar.txt'. Relative pathing '.' and '..' is not allowed.
##[debug]    at Pattern.fixupPattern (/home/runner/runners/2.322.0/bin/hashFiles/index.js:2188:25)
##[debug]    at new Pattern (/home/runner/runners/2.322.0/bin/hashFiles/index.js:2102:27)
##[debug]    at DefaultGlobber.<anonymous> (/home/runner/runners/2.322.0/bin/hashFiles/index.js:1423:42)
##[debug]    at Generator.next (<anonymous>)
##[debug]    at /home/runner/runners/2.322.0/bin/hashFiles/index.js:1269:71
##[debug]    at new Promise (<anonymous>)
##[debug]    at __webpack_modules__.8298.__awaiter (/home/runner/runners/2.322.0/bin/hashFiles/index.js:1265:12)
##[debug]    at DefaultGlobber.create (/home/runner/runners/2.322.0/bin/hashFiles/index.js:1409:16)
##[debug]    at Object.<anonymous> (/home/runner/runners/2.322.0/bin/hashFiles/index.js:1150:56)
##[debug]    at Generator.next (<anonymous>) {
##[debug]  generatedMessage: false,
##[debug]  code: 'ERR_ASSERTION',
##[debug]  actual: false,
##[debug]  expected: true,
##[debug]  operator: '=='
##[debug]}
##[debug]STDOUT/STDERR stream read finished.
##[debug]STDOUT/STDERR stream read finished.

Job Log Output

If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.

N/A

Runner and Worker's Diagnostic Logs

If applicable, add relevant diagnostic log information. Logs are located in the runner's _diag folder. The runner logs are prefixed with Runner_ and the worker logs are prefixed with Worker_. Each job run correlates to a worker log. All sensitive information should already be masked out, but please double-check before pasting here.

N/A

@sybereal sybereal added the bug Something isn't working label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant