Reader small image

You're reading from  GitHub Actions Cookbook

Product typeBook
Published inApr 2024
PublisherPackt
ISBN-139781835468944
Edition1st Edition
Concepts
Right arrow
Author (1)
Michael Kaufmann
Michael Kaufmann
author image
Michael Kaufmann

Michael Kaufmann believes that developers and engineers can be happy and productive at work. He loves DevOps, GitHub, Azure, and modern work. Microsoft has awarded him with the title Microsoft Regional Director (RD) and Microsoft Most Valuable Professional (MVP) – the latter in the category of DevOps and GitHub. Michael is also the founder and managing director of Xebia Microsoft Services, Germany – a consulting company that helps its customers become digital leaders by supporting them in their cloud, DevOps, and digital transformation. Michael shares his knowledge in books, training, and as a frequent speaker at international conferences.
Read more about Michael Kaufmann

Right arrow

Adding output parameters and using job summaries

In this recipe, we’ll add an output parameter to the action that can be used in subsequent steps, and we are going to write content to the workflow job summary.

Getting ready…

You will have to finish the previous recipe to continue with this one.

How to do it…

  1. Open the action.yml file and add the following code right under the inputs section but before the runs section:
    outputs:
      answer:
        description: 'The answer to everything (always 42)'

    This defines one output with an ID of answer.

  2. Next, open entrypoint.sh and add the following line to the end of the file:
    echo "answer=42" >> $GITHUB_OUTPUT

    This will set the output value for answer to 42.

  3. Now, add the following lines to the end of entrypoint.sh to write some Markdown and HTML to the step summary:
    echo "### Hello $@! :rocket:" >> $GITHUB_STEP_SUMMARY
    echo "<h3...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
GitHub Actions Cookbook
Published in: Apr 2024Publisher: PacktISBN-13: 9781835468944

Author (1)

author image
Michael Kaufmann

Michael Kaufmann believes that developers and engineers can be happy and productive at work. He loves DevOps, GitHub, Azure, and modern work. Microsoft has awarded him with the title Microsoft Regional Director (RD) and Microsoft Most Valuable Professional (MVP) – the latter in the category of DevOps and GitHub. Michael is also the founder and managing director of Xebia Microsoft Services, Germany – a consulting company that helps its customers become digital leaders by supporting them in their cloud, DevOps, and digital transformation. Michael shares his knowledge in books, training, and as a frequent speaker at international conferences.
Read more about Michael Kaufmann