Skip to content

GITHUB_WORKSPACE and github.workspace are different when running in container #785

Closed
@nkakouros

Description

@nkakouros

When using a container to run the checkout, the variables ${{ GITHUB_WORKSPACE }} and ${{ github.workspace }} are different.

---

name: CI

on:  # yamllint disable-line rule:truthy
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

  workflow_dispatch: ~

jobs:
  test:
    runs-on: ubuntu-latest
    container:
      image: ubuntu:latest
    steps:
      - uses: actions/checkout@v3
      - run: |
          echo ${{ github.workspace }}
          echo $GITHUB_WORKSPACE

The documentation for github.workspace says:

The default working directory on the runner for steps, and the default location of your repository when using the checkout action.

The documentation for GITHUB_WORKSPACE says:

The default working directory on the runner for steps, and the default location of your repository when using the checkout action.

I believe they should be set to the same value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions