From 7394a02561b25a066e9c9391067d723bf7be93d6 Mon Sep 17 00:00:00 2001 From: Ethan Chiu <17chiue@gmail.com> Date: Tue, 21 Jul 2020 11:33:52 -0400 Subject: [PATCH 1/6] Clarify details for defaults, shell, and working-dir In this commit, I clarify some details for our implementation of shell and working-dir (cc: @ericsciple ) --- docs/adrs/0549-composite-run-steps.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/adrs/0549-composite-run-steps.md b/docs/adrs/0549-composite-run-steps.md index b86bf856acf..dffca0f15af 100644 --- a/docs/adrs/0549-composite-run-steps.md +++ b/docs/adrs/0549-composite-run-steps.md @@ -250,9 +250,21 @@ 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 +### Defaults, Shell, and Working-dir +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. +For each run step in a composite action, the action author can set the `shell` and `working-dir` 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-dir` attributes at the step level for an action. For example, +```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 seperate entities. **So, the workflow `defaults` will never change the `shell` and `working-dir` 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. From 1eb1e0814fdbe30d67eab9cf786b5f21d7d0234c Mon Sep 17 00:00:00 2001 From: Ethan Chiu <17chiue@gmail.com> Date: Tue, 21 Jul 2020 13:03:35 -0400 Subject: [PATCH 2/6] Fix spacing + escape values --- docs/adrs/0549-composite-run-steps.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/adrs/0549-composite-run-steps.md b/docs/adrs/0549-composite-run-steps.md index dffca0f15af..45a61252837 100644 --- a/docs/adrs/0549-composite-run-steps.md +++ b/docs/adrs/0549-composite-run-steps.md @@ -250,10 +250,17 @@ 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, Shell, and Working-dir +### Defaults We will not support "defaults" in a composite action. -For each run step in a composite action, the action author can set the `shell` and `working-dir` 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-dir` attributes at the step level for an action. For example, +### Shell and Working-dir +For each run step in a composite action, the action author can set the `shell` and `working-dir` 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-dir` attributes at the step level for an action. + +For example, + +`action.yml` + + ```yaml inputs: shell_1: From 77ac3bb245e0fc99f92ed26283bc0fb83d75a29f Mon Sep 17 00:00:00 2001 From: Ethan Chiu <17chiue@gmail.com> Date: Tue, 21 Jul 2020 13:07:21 -0400 Subject: [PATCH 3/6] spelling --- docs/adrs/0549-composite-run-steps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/adrs/0549-composite-run-steps.md b/docs/adrs/0549-composite-run-steps.md index 45a61252837..357c790ca13 100644 --- a/docs/adrs/0549-composite-run-steps.md +++ b/docs/adrs/0549-composite-run-steps.md @@ -271,7 +271,7 @@ steps: shell: ${{ inputs.shell_1 }} ``` -Note, the workflow file and action file are treated as seperate entities. **So, the workflow `defaults` will never change the `shell` and `working-dir` 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). +Note, the workflow file and action file are treated as separate entities. **So, the workflow `defaults` will never change the `shell` and `working-dir` 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. From a39f3b5f62ae224ccc30fd843c60f22fb118d409 Mon Sep 17 00:00:00 2001 From: Ethan Chiu <17chiue@gmail.com> Date: Tue, 21 Jul 2020 14:55:56 -0400 Subject: [PATCH 4/6] dir => directory --- docs/adrs/0549-composite-run-steps.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/adrs/0549-composite-run-steps.md b/docs/adrs/0549-composite-run-steps.md index 357c790ca13..81a0cf310f9 100644 --- a/docs/adrs/0549-composite-run-steps.md +++ b/docs/adrs/0549-composite-run-steps.md @@ -254,7 +254,7 @@ For the composite action steps, it follows the same logic as above. In this exam We will not support "defaults" in a composite action. ### Shell and Working-dir -For each run step in a composite action, the action author can set the `shell` and `working-dir` 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-dir` attributes at the step level for an action. +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. For example, @@ -271,7 +271,7 @@ steps: 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-dir` 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). +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. From f17549b55158c0df05a9c1c3c43a7768d1ccddbb Mon Sep 17 00:00:00 2001 From: Ethan Chiu <17chiue@gmail.com> Date: Wed, 22 Jul 2020 09:34:51 -0400 Subject: [PATCH 5/6] working-dir => working-directory --- docs/adrs/0549-composite-run-steps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/adrs/0549-composite-run-steps.md b/docs/adrs/0549-composite-run-steps.md index 81a0cf310f9..18c58c74406 100644 --- a/docs/adrs/0549-composite-run-steps.md +++ b/docs/adrs/0549-composite-run-steps.md @@ -253,7 +253,7 @@ For the composite action steps, it follows the same logic as above. In this exam ### Defaults We will not support "defaults" in a composite action. -### Shell and Working-dir +### 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. For example, From cdfed7908688bf2def9332694e3f2dd59e54d7a3 Mon Sep 17 00:00:00 2001 From: Ethan Chiu <17chiue@gmail.com> Date: Wed, 22 Jul 2020 15:45:43 -0400 Subject: [PATCH 6/6] Dummy Commit To Trigger Tests --- docs/adrs/0549-composite-run-steps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/adrs/0549-composite-run-steps.md b/docs/adrs/0549-composite-run-steps.md index 18c58c74406..b7feb814176 100644 --- a/docs/adrs/0549-composite-run-steps.md +++ b/docs/adrs/0549-composite-run-steps.md @@ -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