-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Clarify details for defaults, shell, and working-dir #607
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
Changes from all commits
7394a02
1eb1e08
77ac3bb
a39f3b5
f17549b
cdfed79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ An important step towards meeting this goal is to build in functionality for act | |
|
|
||
| We don't want the workflow author to need to know how the internal workings of the action work. Users shouldn't know the internal workings of the composite action (for example, `default.shell` and `default.workingDir` should not be inherited from the workflow file to the action file). When deciding how to design certain parts of composite run steps, we want to think one logical step from the consumer. | ||
|
|
||
| A composite action is treated as **one** individual job step (aka encapsulation). | ||
| A composite action is treated as **one** individual job step (this is known as encapsulation). | ||
|
|
||
|
|
||
| ## Decision | ||
|
|
@@ -251,8 +251,27 @@ If any of the steps fail in the composite action and the `continue-on-error` is | |
| For the composite action steps, it follows the same logic as above. In this example, `"Hello World 2"` will be outputted because the previous step has `continue-on-error` set to `true` although that previous step errored. | ||
|
|
||
| ### Defaults | ||
| We will not support "defaults" in a composite action. | ||
|
|
||
| The composite action author will be required to set the `shell` and `workingDir` of the composite action. Moreover, the composite action author will be able to explicitly set the shell for each composite run step. The workflow author will not have the ability to change these attributes. | ||
| ### Shell and Working-directory | ||
| For each run step in a composite action, the action author can set the `shell` and `working-directory` attributes for that step. These attributes are optional for each run step - by default, the `shell` is set to whatever default value is associated with the runner os (ex: bash =\> Mac). Moreover, the composite action author can map in values from the `inputs` for it's `shell` and `working-directory` attributes at the step level for an action. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This doesn't appear to be true. Removing the
|
||
|
|
||
| For example, | ||
|
|
||
| `action.yml` | ||
|
|
||
|
|
||
| ```yaml | ||
| inputs: | ||
| shell_1: | ||
| description: 'Your name' | ||
| default: 'pwsh' | ||
| steps: | ||
| - run: echo 1 | ||
| shell: ${{ inputs.shell_1 }} | ||
| ``` | ||
|
|
||
| Note, the workflow file and action file are treated as separate entities. **So, the workflow `defaults` will never change the `shell` and `working-directory` value in the run steps in a composite action.** Note, `defaults` in a workflow only apply to run steps not "uses" steps (steps that use an action). | ||
|
|
||
| ### Visualizing Composite Action in the GitHub Actions UI | ||
| We want all the composite action's steps to be condensed into the original composite action node. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.