Last active
May 21, 2024 21:06
Revisions
-
jonlabelle revised this gist
May 21, 2024 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Prints a debug message to the log. You must create a secret named `ACTIONS_STEP_DEBUG` with the value true to see the debug messages set by this command in the log. > [!NOTE] > Requires [debug logging enabled](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging). ```console @@ -48,6 +48,8 @@ file. run: echo "::notice file=app.js,line=1,col=5,endColumn=7::Missing semicolon" run: echo "::notice title=Heads up::I need to make you aware of something" run: echo "::notice title=✓ Test passed::Have a great rest of the day/night!" ``` > [Notice message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message) @@ -90,6 +92,8 @@ file. run: echo "::error file=app.js,line=1,col=5,endColumn=7::Missing semicolon" run: echo "::error title=Uh oh::Something failed. Here are some steps to correct the problem." run: echo "::error title=✘ Test failed::You probably want to fix this." ``` > [Error message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message) -
jonlabelle revised this gist
May 21, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -101,5 +101,5 @@ run: echo "::error title=Uh oh::Something failed. Here are some steps to correct - date: May 21, 2024 - source: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions - snippet: https://jonlabelle.com/snippets/view/markdown/github-workflow-commands-for-message-output - gist: https://gist.github.com/jonlabelle/69c79a59c69d2f0bff6dda9348f3fa2d --- -
jonlabelle created this gist
May 21, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,105 @@ # GitHub workflow commands for message output Use the `::` syntax to run the workflow commands within your YAML file; these commands are then sent to the runner over stdout. ## Message output ### Debug Prints a debug message to the log. You must create a secret named `ACTIONS_STEP_DEBUG` with the value true to see the debug messages set by this command in the log. > [!NOTE] > Requires [debug logging enabled](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging). ```console ::debug::{message} ``` > [Debug message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-debug-message) #### Example debug messages ```yaml run: echo "::debug::Set the Octocat variable" ``` ### Notice Creates a notice message and prints the message to the log. This message will create an annotation, which can associate the message with a particular file in your repository. Optionally, your message can specify a position within the file. ```console ::notice file={name},line={line},endLine={endLine},title={title}::{message} ``` #### Example notice messages Creates a notice message and prints the message to the log. This message will create an annotation, which can associate the message with a particular file in your repository. Optionally, your message can specify a position within the file. ```yml run: echo "::notice file=app.js,line=1,col=5,endColumn=7::Missing semicolon" run: echo "::notice title=Heads up::I need to make you aware of something" ``` > [Notice message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message) ### Warning Creates a warning message and prints the message to the log. This message will create an annotation, which can associate the message with a particular file in your repository. Optionally, your message can specify a position within the file. ```console ::warning file={name},line={line},endLine={endLine},title={title}::{message} ``` #### Example warning messages ```yaml run: echo "::warning file=app.js,line=1,col=5,endColumn=7::Missing semicolon" run: echo "::warning title=Oops::Something didn't go quite as expected" ``` > [Warning message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message) ### Error Creates an error message and prints the message to the log. This message will create an annotation, which can associate the message with a particular file in your repository. Optionally, your message can specify a position within the file. ```console ::error file={name},line={line},endLine={endLine},title={title}::{message} ``` #### Example error messages ```yaml run: echo "::error file=app.js,line=1,col=5,endColumn=7::Missing semicolon" run: echo "::error title=Uh oh::Something failed. Here are some steps to correct the problem." ``` > [Error message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message) --- - title: GitHub workflow commands for message output - subtitle: Examples of writing GitHub workflow messages to stdout. - date: May 21, 2024 - source: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions - snippet: https://jonlabelle.com/snippets/view/markdown/github-workflow-commands-for-message-output - gist: ---