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

Allow to specify a working-directory #89

Open
Luc45 opened this issue Aug 4, 2022 · 9 comments
Open

Allow to specify a working-directory #89

Luc45 opened this issue Aug 4, 2022 · 9 comments
Assignees

Comments

@Luc45
Copy link

Luc45 commented Aug 4, 2022

Describe the bug
My workflow expects the script to be executed from a specific directory, so I use something like this:

- name: Do foo
  working-directory: some-dir
  run: ./foo

When porting this to retry, I cannot set the working-directory for the step, as it only works with run.

Similar issue: https://stackoverflow.com/questions/67299058/running-github-actions-for-uses-in-another-directory

Expected behavior
Retry should allow to specify a working-directory

Screenshots
If applicable, add screenshots to help explain your problem.

image

@tamascsaba
Copy link

tamascsaba commented Aug 8, 2022

It would be really great to support the default working-directory too:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-set-the-default-shell-and-working-directory

@martijnvdbrug
Copy link

martijnvdbrug commented Aug 18, 2022

First of all, great action!
@tamascsaba this would also be my prefered way of working. I defined my default working directory in the action, and all other steps use this directory except the retry-action.

jobs:
  test:
    name: E2e testing
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
        working-directory: packages/e2e

Supporting this would be great!

@tamirble
Copy link

I'm joining this request 🙏

@ShubhamRasal
Copy link

I'm joining this request too

1 similar comment
@NickDub
Copy link

NickDub commented Dec 13, 2022

I'm joining this request too

l0b0 added a commit to linz/emergency-management-tools that referenced this issue Jan 30, 2023
Workarounds:

- Flaky Python temporary directory removal on Windows
  <python-poetry/poetry-core#460>.
- Mandatory timeout <nick-fields/retry#107>.
- Misleading `poetry --directory` functionality
  <https://github.com/python-poetry/poetry/issues/7363>/Missing option
  for working directory
  <nick-fields/retry#89>.
l0b0 added a commit to linz/emergency-management-tools that referenced this issue Jan 30, 2023
Workarounds:

- Flaky Python temporary directory removal on Windows
  <python-poetry/poetry-core#460>.
- Mandatory timeout <nick-fields/retry#107>.
- Misleading `poetry --directory` functionality
  <https://github.com/python-poetry/poetry/issues/7363>/Missing option
  for working directory
  <nick-fields/retry#89>.
aaronchongth added a commit to open-rmf/rmf-web that referenced this issue Apr 3, 2023
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
aaronchongth added a commit to open-rmf/rmf-web that referenced this issue Apr 3, 2023
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
aaronchongth added a commit to open-rmf/rmf-web that referenced this issue May 1, 2023
* Retry on dashboard-e2e nightly

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Retry on general dashboard-e2e workflow

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Setting required timeout_minutes to 20, removing optional retry_on

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Adding working-directory on step due to nick-fields/retry#89

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

---------

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@bdlake
Copy link

bdlake commented Mar 7, 2024

Love this action, but would love it more if working-directory was an input :)

@zburgermeiszter
Copy link

Less than ideal, but it is possible to make it work in a folder by using a multi-line command and use cd.

- name: Install npm dependencies
        uses: nick-fields/retry@v3
        if: ${{ steps.setupNode.outputs.cache-hit != 'true' }}
        with:
          timeout_minutes: 10
          max_attempts: 3
          command: |
            cd apps/frontend
            npm ci

@dbudwin
Copy link

dbudwin commented Jun 11, 2024

@zburgermeiszter A simpler way to do this would be:

- name: Install npm dependencies
  uses: nick-fields/retry@v3
  if: ${{ steps.setupNode.outputs.cache-hit != 'true' }}
  with:
    timeout_minutes: 10
    max_attempts: 3
    command: npm ci --prefix apps/frontend

@zburgermeiszter
Copy link

Good shout @dbudwin

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

10 participants