docs icon indicating copy to clipboard operation
docs copied to clipboard

Please document `jobs.<job_id>.defaults.run.working-directory` because it's important

Open jsoref opened this issue 1 year ago • 2 comments
trafficstars

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun

What part(s) of the article would you like to see updated?

There should be a jobs.<job_id>.defaults.run.working-directory

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun Says:

Use jobs.<job_id>.defaults.run to provide default shell and working-directory to all run steps in the job. This keyword can reference several contexts. For more information, see "Contexts."

That should be visible in the ToC on the right, and have proper paragraphs. I shouldn't have to read the entire document to discover this.

Additional information

It should explain how it interacts with previous levels.

There's a workflow that uses a global:

defaults:
  run:
    working-directory: ruby

I have no idea how to reset the working directory to the default in one job.

jsoref avatar Jan 30 '24 13:01 jsoref

@jsoref Thank you for opening an issue! I'll get this triaged for review ✨

nguyenalex836 avatar Jan 30 '24 20:01 nguyenalex836

Fwiw, jobs.<job_id>.defaults.run.working-directory does indeed work. But I shouldn't have had to guess.

jsoref avatar Jan 30 '24 22:01 jsoref

@jsoref Thank you for your patience while we reviewed this! 👋

The team agrees documenting jobs.<job_id>.defaults.run.working-directory would be valuable. You, or anyone else, are welcome to submit a PR with this fix 💛

nguyenalex836 avatar Mar 05 '24 22:03 nguyenalex836