actions / actions/runner

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

Open
#728 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

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

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 containerized-action handling of the github.workspace and runner.workspace expressions, including environment-parameter conversion and Docker volume destinations. Reproduce the three environment-variable cases from the issue and verify that the original workspace path remains available where expected without changing the default /github/workspace behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, github-actions
Domain
ci-cd, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.