Skip to content

[suggestion] Respect the job:defaults:run:working-directory as the default path #516

Open
@kuvaldini

Description

@kuvaldini

As I feel GITHUB_WORKSPACE should correspond to working-directory. But it does not. And we have no GITHUB_WORKDIR env variable.

My current workflow looks like:

build-iroha-windows:
    runs-on: windows-latest
    defaults:
      run:
        shell: bash
        working-directory: &workdir 'C:\github\iroha'  ## Use disk C: because D: is out of space
    steps:
      - name: create working-directory
        run: set -x; mkdir -p "$workdir"; echo $PWD
        working-directory: 'C:\'
        env: { workdir: *workdir }
     - 
        name: Checkout
        uses: actions/checkout@v2
        with: 
          path: *workdir 

Here you can see YAML anchors. They are dereferenced with yq eval 'explode(.)'

All scripts runs in C:\github\iroha, so I also would like to checkout to that directory.

Suggestion

Add preference path to checkout to:

  1. with:path
  2. job:defaults:run:working-directory
  3. GITHUB_WORKSPACE

if with:path is relative, than try to be relative to job:defaults:run:working-directory(if not empty) before GITHUB_WORKSPACE

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