Skip to content

Action fails on self-hosted runners (GHES, RHEL9): lstat /github: no such file or directory #2607

@periyasamy003

Description

@periyasamy003

Describe the bug
When using mikefarah/yq@master as a GitHub Action on a self-hosted runner (e.g., RHEL9), the action fails with:

cannot resolve /github/home: lstat /github: no such file or directory

This is because, on self-hosted runners, the /github directories (/github/home, /github/workflow, etc.) do not exist by default, whereas they are present on GitHub-hosted runners. This causes the Docker container in the action to fail on self-hosted or GHES setups.

Note that any how to questions should be posted in the discussion board and not raised as an issue.

Version of yq: 4.X.X (as pulled by mikefarah/yq@master Action)
Operating system: linux (RHEL9 self-hosted GitHub runner)
Installed via: docker (within the GitHub Action)

Input Yaml
deployment.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: xxx
spec:
  template:
    spec:
      containers:
        - image: someimage:old

Command
The command you ran:

- uses: mikefarah/yq@master
  with:
    cmd: yq -i '.spec.template.spec.containers[0].image = "someimage:new"' deployment.yaml

or from the workflow:

yq -i '.spec.template.spec.containers[0].image = "someimage:new"' deployment.yaml

Actual behaviour

cannot resolve /github/home: lstat /github: no such file or directory

Expected behaviour
Action completes without error and the image is updated in deployment.yaml, regardless of whether runner is self-hosted or GitHub-hosted.

Additional context
This seems due to the action's expectation of /github/* directories existing in the container, which is not always true on self-hosted runners. Creating these directories in the container image or entrypoint would resolve the error and make the action more portable for GitHub Enterprise Server (GHES) and non-GitHub-hosted runners.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions