question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Containerized action workspace directories seems to be rewritten on-the-fly

See original GitHub issue

In a containerized action, where docker volumes are automatically mounted, the default github.workspace property (something like /home/runner/work/my-repo-name/my-repo-name) is automatically converted to the volume destination path (/github/workspace). Btw, this conversion seems to be applied on-the-fly on all action parameters, stopping ability to use the original workspace path (/home/runner/work/my-repo-name/my-repo-name) in custom behaviors (such as - for instance - mounting workspace volumes in a docker-in-docker context)

Steps to reproduce the behavior:

  1. Define some environment variables in a containerized action
      - name: Test
        uses: gofrolist/molecule-action@v2
        env:
          DEST_WORKSPACE: ${{ github.workspace }}
          SRC_WORKSPACE: ${{ runner.workspace }}/${{ github.event.repository.name }}
          SRC_WORKSPACE_FOO: ${{ runner.workspace }}/foo/${{ github.event.repository.name }}
  1. See error
  • DEST_WORKSPACE is /github/workspace and not /home/runner/work/my-repo-name/my-repo-name, that’s fine 😃
  • SRC_WORKSPACE should be the original /home/runner/work/my-repo-name/my-repo-name as it’s exactly how checkout action compose it but is /github/workspace
  • SRC_WORKSPACE_FOO where the original workspace is poorman’s obfuscated by injected a “foo” string is /home/runner/work/my-repo-name/foo/my-repo-name

Expected behavior I expected to be able to use the original workspace /home/runner/work/my-repo-name/my-repo-name directory string in custom situations.

Runner Version and Platform

The last available one on linux

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
matt-mercercommented, Sep 1, 2022

I’d also like to add my backing to this issue … it’s all well and good saying don’t use explicit paths, but it is not uncommon for some tools to bake in explicit paths, I’m working with python, a couple of examples I’ve hit, virtualenv console scripts and coverage.xml files contain a reference to the explicit location the coverage was generated.

It is a totally reasonable request for either:

  • the workspace volume mount location to mirror the host location or
  • the workspace volume mount location to be configurable on any action

this is is the sort of annoyance that can ( and has today for me ) burn days of effort trying to workaround issues of compatibility between tests generated on the host, and static analysis tooling running in a an action.

1reaction
ruvceskistefancommented, Mar 28, 2022

I’m going to close out this issue until we hear back from you, please let us know if you are still seeing this issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Action I wrote doesn't have access to repo's files ...
I have a custom GitHub Action I've written as well with python as the base image in the Docker container but want the...
Read more >
Using Docker Run inside of GitHub Actions
Here I'm creating a bind mount from the current workspace to /var/www , which is the working directory that my Docker image expects....
Read more >
Backup station qnap download. 2. ...
(2) Customize view mode: timeline, thumbnail, list, folder, . 1. On Download Station 5 -> Settings -> Add-on (tab) it seems to show...
Read more >
Using Docker Containers with GitHub Actions - YouTube
You'll learn: - What GitHub actions do, in brief - How to use a ... Using a container for a whole job -...
Read more >
Hashicorp mysql provider. CSI providers are third-party ...
Create a directory named learn-terraform-docker-container. 0 and run terraform init and again, everything is fine: This tutorial demonstrates how to use a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found