Repository: actions/runner

Issue #2058: github.workspace and runner.workspace are incorrect inside container jobs
Created: 2022-08-16T11:10:17Z
Describe the bug
github.Workspace and runner.Workspace don't point to container valid paths when executing inside a container job.
The values are also inconsistent with the values for env variables GITHUB_WORKSPACE and RUNNER_WORKSPACE (both contain a valid path.
To Reproduce
Steps to reproduce the behavior:

Create a workflow with the following jobs

jobs:
  runner:
    runs-on: ubuntu-latest

    steps:
      - name: dump
        run: |
          echo 'github.workspace === ${{ github.workspace }}'
          echo "GITHUB_WORKSPACE === $GITHUB_WORKSPACE"
          echo 'runner.workspace === ${{ runner.workspace }}'
          echo "RUNNER_WORKSPACE === $RUNNER_WORKSPACE"
  container:    
    runs-on: ubuntu-latest
    container:
      image: node:14.16
      
    steps:
      - name: dump
        run: |
          echo 'github.workspace === ${{ github.workspace }}'
          echo "GITHUB_WORKSPACE === $GITHUB_WORKSPACE"
          echo 'runner.workspace === ${{ runner.workspace }}'
          echo "RUNNER_WORKSPACE === $RUNNER_WORKSPACE"

Check the value in the container job for ${{ github.workspace  }} and $GITHUB_WORKSPACE which are not the same
Check the value in the container job   for ${{ runner.workspace  }} and $RUNNER_WORKSPACE which are not the same

Expected behavior
On the container job github.workspaceand runner.workspace should point to a path in the directory /__w
Runner Version and Platform
Version of your runner? 2.295.0
OS of the machine running the runner? ubuntu 20.04.4 (ubuntu-latest)
What's not working?
The values for github.workspace and runner.workspace are incorrect in the container job (and inconsistent with respective env variables)
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.
Output of container dump step  in the container job
github.workspace === /home/runner/work/testContainers/testContainers
GITHUB_WORKSPACE === /__w/testContainers/testContainers
runner.workspace === /home/runner/work/testContainers
RUNNER_WORKSPACE === /__w/testContainers
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.

Duplicate issue #763: Matched problems dropped when running in container
Created: 2020-10-21T07:24:38Z
Describe the bug
A problem matcher enabled using a 'normal' run step in a job running in a container drops all issues with "Dropping file value ... Path is not under the workflow repo." Removing the container option from the workflow file (such that it runs on ubuntu-latest) and leaving all configuration unchanged does not drop the issues and creates annotations as expected.
To Reproduce
Steps to reproduce the behavior:

Create a workflow with a configuration similar to (the example uses eslint):

name: PR Linting

on:
  pull_request:
    branches: [ develop ]

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    container:
      image: node:14.13.1

    steps:
      - uses: actions/checkout@v2

      - name: Enable problem matcher
        run: echo "::add-matcher::.github/problem-matchers/eslint.json"

      - name: Run linter
        run: npm run lint

Add the actual problem matcher (I used the multiline example: https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md)
Run it
Warnings / errors will be highlighted, but no annotations created.
Remove the container section from the definition
Warnings / errors will be highlighted and annotations will be created.

Expected behavior
Matched issues resulting in annotations when running in a container.
Runner Version and Platform
2.273.5 on GitHub.com
OS of the machine running the runner? OSX/Windows/Linux/...
Ubuntu 18.04.5
What's not working?

Job Log Output
See screenshot

Closing comment (2023-02-18T03:42:33Z): Variable mismatch related to #2058