How do you use `GITHUB_STEP_SUMMARY`, annotations and workflow commands?
IntermediateConceptGitHub Actions
Answer
Appending Markdown to $GITHUB_STEP_SUMMARY renders a summary on the run page. Workflow commands written to stdout create annotations and control logging: ::error file=app.js,line=10::message, ::warning::, ::group::name and ::endgroup::, and ::add-mask::value to mask a value in logs.
echo "### Test results" >> "$GITHUB_STEP_SUMMARY"
echo "Passed: 482 Failed: 0" >> "$GITHUB_STEP_SUMMARY"
echo "::warning file=src/db.js,line=42::Deprecated API"
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate