cypress-io / cypress-io/github-action

Document restrictions on start command's first parameter

Open
#482 1 comment 4 reactions 0 assignees View on GitHub
documentation
Dominant language
JavaScript
Stars
1.5k
Forks
353
Avg merge
1d 22h
Merged PRs (30d)
27

Description

I just spent hours scratching my head trying to understand why my server would not start and always get the error:

```shell
Unable to locate executable file: [...]
```

The file is actually there and is executable.
```yaml
- uses: cypress-io/github-action@v2
env:
[...]
DEBUG: '@cypress/github-action'
with:
[...]
path: e2e
start: ../some/executable/script
```

It turns out `io.which` from `@actions/io`, called by this GitHub action, refuses to parse executable paths from relative script files. I assume this is for security reasons ([actual source](https://github.com/actions/toolkit/blob/daf8bb00606d37ee2431d9b1596b88513dcf9c59/packages/io/src/io.ts#L257-L260)):
```typescript
if (tool.includes(path.sep)) {
return []
}
```

I believe the documentation of `start` should clearly state that scripts cannot be executed like this.

As a workaround, I ran:

```yaml
- uses: cypress-io/github-action@v2
env:
[...]
DEBUG: '@cypress/github-action'
with:
[...]
path: e2e
start: sh ../some/executable/script
```

and it works just fine.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.