Skip to content

Commit

Permalink
Workflow commands: Minor tweaks to example formatting, syntax (#28767)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc authored Oct 3, 2023
1 parent da6e05f commit fa371f4
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ You can use the `set-output` command in your workflow to set the same value:
```yaml copy
- name: Set selected color
run: echo '::set-output name=SELECTED_COLOR::green'
id: random-color-generator
id: color-selector
- name: Get color
{% raw %}
run: echo "The selected color is ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}"
run: echo "The selected color is ${{ steps.color-selector.outputs.SELECTED_COLOR }}"
{% endraw %}
```

Expand All @@ -118,10 +118,10 @@ You can use the `set-output` command in your workflow to set the same value:
```yaml copy
- name: Set selected color
run: Write-Output "::set-output name=SELECTED_COLOR::green"
id: random-color-generator
id: color-selector
- name: Get color
{% raw %}
run: Write-Output "The selected color is ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}"
run: Write-Output "The selected color is ${{ steps.color-selector.outputs.SELECTED_COLOR }}"
{% endraw %}
```

Expand Down Expand Up @@ -509,8 +509,8 @@ jobs:
GENERATED_SECRET=$((RANDOM))
echo "::add-mask::$GENERATED_SECRET"
SECRET_HANDLE=$(secret-store store-secret "$GENERATED_SECRET"){% ifversion actions-save-state-set-output-envs %}
echo "handle=$secret_handle" >> "$GITHUB_OUTPUT"{% else %}
echo "::set-output name=handle::$secret_handle"{% endif %}
echo "handle=$SECRET_HANDLE" >> "$GITHUB_OUTPUT"{% else %}
echo "::set-output name=handle::$SECRET_HANDLE"{% endif %}
secret-consumer:
runs-on: macos-latest
needs: secret-generator
Expand Down Expand Up @@ -921,11 +921,11 @@ This example demonstrates how to set the `SELECTED_COLOR` output parameter and l

```yaml copy
- name: Set color
id: random-color-generator
id: color-selector
run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT"
- name: Get color
env:{% raw %}
SELECTED_COLOR: ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}{% endraw %}
SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}{% endraw %}
run: echo "The selected color is $SELECTED_COLOR"
```

Expand All @@ -937,12 +937,12 @@ This example demonstrates how to set the `SELECTED_COLOR` output parameter and l

```yaml copy
- name: Set color
id: random-color-generator
id: color-selector
run: |
"SELECTED_COLOR=green" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: Get color
       env:{% raw %}
         SELECTED_COLOR: ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}{% endraw %}
env:{% raw %}
SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}{% endraw %}
run: Write-Output "The selected color is $env:SELECTED_COLOR"
```

Expand Down

0 comments on commit fa371f4

Please sign in to comment.