Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kuvaldini opened this issue Jun 1, 2021 · 0 comments

Comments

@kuvaldini
Copy link

kuvaldini commented Jun 1, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant