Skip to content

Commit 17ac762

Browse files
author
Martin Lopes
committed
Switched to uuidgen, added clearer example messages
1 parent 8464049 commit 17ac762

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

content/actions/using-workflows/workflow-commands-for-github-actions.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,14 @@ jobs:
395395
workflow-command-job:
396396
runs-on: ubuntu-latest
397397
steps:
398-
- name: disable workflow commands
398+
- name: Disable workflow commands
399399
run: |
400-
echo '::warning:: this is a warning'
401-
echo "::stop-commands::`echo -n ${{ github.token }} | sha256sum | head -c 64`"
402-
echo '::warning:: this will NOT be a warning'
403-
echo "::`echo -n ${{ github.token }} | sha256sum | head -c 64`::"
404-
echo '::warning:: this is a warning again'
400+
echo '::warning:: This is a warning message, to demonstrate that commands are being processed.'
401+
stopMarker=$(uuidgen)
402+
echo "::stop-commands::$stopMarker"
403+
echo '::warning:: This will NOT be rendered as a warning, because stop-commands has been invoked.'
404+
echo "::$stopMarker::"
405+
echo '::warning:: This is a warning again, because stop-commands has been turned off.'
405406
```
406407
{% endraw %}
407408

@@ -415,14 +416,14 @@ jobs:
415416
workflow-command-job:
416417
runs-on: windows-latest
417418
steps:
418-
- name: disable workflow commands
419+
- name: Disable workflow commands
419420
run: |
420-
Write-Output '::warning:: this is a warning'
421+
Write-Output '::warning:: This is a warning message, to demonstrate that commands are being processed.'
421422
$stopMarker = New-Guid
422423
Write-Output "::stop-commands::$stopMarker"
423-
Write-Output '::warning:: this will NOT be a warning'
424+
Write-Output '::warning:: This will NOT be rendered as a warning, because stop-commands has been invoked.'
424425
Write-Output "::$stopMarker::"
425-
Write-Output '::warning:: this is a warning again'
426+
Write-Output '::warning:: This is a warning again, because stop-commands has been turned off.'
426427
```
427428

428429
{% endraw %}

0 commit comments

Comments
 (0)