Skip to content

working-directory is being ignored #74

Open
@Zerotask

Description

@Zerotask

In my job, I have set a working-directory (docs/user) right at the start.

runs-on: ubuntu-latest
defaults:
  run:
    working-directory: ./docs/user

In this directory I run a build step which creates a dist directory (docs/user/dist).

If you try to run

- name: Upload artifact
  uses: actions/upload-pages-artifact@v2
  with:
    path: "dist"

you will get the error:

Run actions/upload-pages-artifact@v2
  with:
    path: dist
    name: github-pages
    retention-days: 1
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.4/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib
    GITHUB_PAGES: true
Run tar \
  tar \
    --dereference --hard-dereference \
    --directory "$INPUT_PATH" \
    -cvf "$RUNNER_TEMP/artifact.tar" \
    --exclude=.git \
    --exclude=.github \
    .
  shell: /usr/bin/sh -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.4/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib
    GITHUB_PAGES: true
    INPUT_PATH: dist
tar: dist: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
Error: Process completed with exit code 2.

I'd assume that it considers my previously set working-directory, but I had to change it to path: "docs/user/dist"

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