Clarify that working-directory only applies to run steps - #46126
Closed
aniruddhaadak80 wants to merge 1 commit into
Closed
aniruddhaadak80 wants to merge 1 commit into
aniruddhaadak80 wants to merge 1 commit into
Conversation
The jobs.<job_id>.steps[*].working-directory section documented the keyword without stating that it is only valid on steps that use un. The workflow schema marks a step that sets working-directory without un as invalid, so the page left readers to assume a constraint that the product actually enforces. Fixes github#42699
Contributor
How to review these changes 👓Thank you for your contribution. To review these changes, choose one of the following options: A Hubber will need to deploy your changes internally to review. Table of review linksNote: Please update the URL for your staging server or codespace. The table shows the files in the
Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server 🤖 This comment is automatically generated. |
Contributor
|
This issue isn't open to contributors, so I'm going to close this out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why:
Closes: #42699
What's being changed (if available, include any code snippets, screenshots, or gifs):
Summary
The
jobs.<job_id>.steps[*].working-directorysection described the keyword without stating that it only applies to steps that userun. This pull request adds that missing constraint.Root cause
This is a content-accuracy gap rather than a code defect, so there is no code path to fix. The section's only statement about the keyword was:
The word "command" hints at
run, but the page never states the rule, so a reader can reasonably addworking-directoryto a step that calls an action withuses. That step is invalid, which is the confusion the issue describes.The constraint is real and enforced. In the workflow JSON schema, the
stepdefinition carries:That makes a step which sets
working-directorywithoutruninvalid. The samenotblock already coversshell, so the gap is specific toworking-directorybeing left undocumented in prose.Changes
content/actions/reference/workflows-and-actions/workflow-syntax.md- added two sentences to thejobs.<job_id>.steps[*].working-directorysection stating that you can only useworking-directoryin a step that runs a command withrun, and cannot use it in a step that calls an action withuses.The existing YAML example and the follow-up paragraph pointing at
defaults.run.working-directoryare unchanged. The wording reuses the "runsteps" term that the surrounding sections already use.Testing
This is a content-only change, so there is no unit test that fails before the fix and passes after; the gate that applies to
content/edits here is the content linter. I ran it against the edited file:npm run lint-content, which lints changed and staged files by default, also reports no errors and exits 0.One environment note for anyone reproducing this:
package.jsonrequires Node^24 || ^26, while the machine I used has Node v22.23.2, which does not haveRegExp.escape.src/data-directory/lib/filename-to-key.tscallsRegExp.escapeat import time, so the linter aborts on stock Node 22 before it inspects any content. I supplied aRegExp.escapepolyfill throughNODE_OPTIONS=--importfor the run above, and changed no repository file to do so. On CI, which runs a supported Node version, the linter runs without that shim.Check off the following:
Fixes #42699