-
Notifications
You must be signed in to change notification settings - Fork 424
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
How to run in a specific directory #412
Comments
You could try using the Node |
@joshmgross, thank you so much for your reply. I would like to follow up with a thought and request. Your suggestion serves as a great stopgap. However, doing so couples the script to the specific project file-structure. As a consequence, any changes in the project file-structure would result in a CI failure. Such a failure would be difficult to diagnose and remedy. In addition, it breaks consistency with the known pattern for handling this kind of scenario (see defaults.run). jobs:
job1:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./scripts # <- sets the directory from which to run the bash script I think that given that this action is published by github.com, there is an implicit expectation that it would remain consistent with the conventions and maintain consistency with prior art. I suggest if possible, to have the script offer an option Would it be costly on your end to provide a parameter - name: Terraform Comment
uses: actions/github-script@v6
env:
TFPLAN_IDENTIFIER: "${{ steps.plan.outputs.tfplan_identifier}}"
PLAN_OUTPUT: "${{ steps.plan.outputs.stdout }}"
PLAN_ERROR: "${{ steps.plan.outputs.stderr }}"
with:
working-directory: './some-dir' # defaults to `defaults.run.working-directory` if unspecified.
script: |
... |
Just thought id leave a solution with what i did as im pretty happy with it. Since
|
@joshmgross I used the approach you mentioned and it does work, I appreciate the help ❤️ |
Glad to hear it @asilverman. |
I have a workflow which makes use of the
working-directory
. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun although this does not work withuses
.Below i use github-script.
How do i force github-script to run in a specific directory.
The text was updated successfully, but these errors were encountered: