Skip to content

Use working-directory for entire job #25742

Answered by Yanjingzhu
dakom asked this question in Actions
Discussion options

You must be logged in to vote

When you use jobs.<job_id>.steps.run , using the working-directory keyword, you can specify the working directory of where to run the command. You need to add work-directory keyword to all jobs.<job_id>.steps.run.

Please refer to this document for more details.

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsrun

If you want to use working-directory for entire job, I would suggest to set a job level environment variable, set its value with the directory, and then use context with ${{ env.variablename}} as the value of work-directory keyword in jobs.<job_id>.steps.run.  

For Contexts syntax for GitHub Actions …

Replies: 20 comments 14 replies

Comment options

You must be logged in to vote
8 replies
@SeiwonPark
Comment options

@dnut
Comment options

@SeiwonPark
Comment options

@Adamou02
Comment options

@james-wangx
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ktulark
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@tshakah
Comment options

Comment options

You must be logged in to vote
1 reply
@janosh
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@uuf6429
Comment options

Comment options

You must be logged in to vote
1 reply
@ornakash
Comment options

Comment options

You must be logged in to vote
1 reply
@Jean1dev
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD