<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rafael</title>
    <description>The latest articles on DEV Community by Rafael (@rafael_svieira).</description>
    <link>https://dev.to/rafael_svieira</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1144087%2F757487cd-be56-42c6-8683-5377bd18e8f3.png</url>
      <title>DEV Community: Rafael</title>
      <link>https://dev.to/rafael_svieira</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rafael_svieira"/>
    <language>en</language>
    <item>
      <title>Github Actions certificate</title>
      <dc:creator>Rafael</dc:creator>
      <pubDate>Thu, 08 Feb 2024 01:51:37 +0000</pubDate>
      <link>https://dev.to/rafael_svieira/github-actions-certificate-2hnj</link>
      <guid>https://dev.to/rafael_svieira/github-actions-certificate-2hnj</guid>
      <description>&lt;h2&gt;
  
  
  Introduce
&lt;/h2&gt;

&lt;p&gt;In 2018, &lt;a href="https://github.blog/2018-10-17-action-demos/"&gt;Github lauched the Github Actions&lt;/a&gt; with the purpose of making it easier to build, test, and deploy your projects on any platform, including Linux, macOS, and Windows.&lt;/p&gt;

&lt;p&gt;I have been working with GitHub Actions since 2021, and since then, I have witnessed its powerful capabilities, the multiple options available to solve various problems, and how quickly the solution has grown with new functionalities released every year.&lt;/p&gt;

&lt;p&gt;At the end of 2023, Github announced 4 certifications, &lt;code&gt;Github Foundation&lt;/code&gt;, &lt;code&gt;Github Actions&lt;/code&gt;, &lt;code&gt;Advanced Security&lt;/code&gt; and &lt;code&gt;Administration&lt;/code&gt;. This post will focused only about &lt;code&gt;Github Actions&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Github Actions exam
&lt;/h2&gt;

&lt;p&gt;Until now, the certification is still in beta, so there isn't a lot of information about the exam structure, the passing score, or the duration of the exam in the &lt;a href="https://examregistration.github.com/faq"&gt;FAQ&lt;/a&gt;. Therefore, I'm going to explain my experience with the whole process.&lt;/p&gt;

&lt;p&gt;First of all, it's necessary to &lt;a href="https://examregistration.github.com/overview"&gt;register&lt;/a&gt; for the desired certificate and schedule the exam. In my case, I scheduled it through the PSI platform and took the exam at home. I paid $99, but the price is currently 50% off because the exam is in beta mode.&lt;/p&gt;

&lt;p&gt;The exam consists of 75 questions, some of which require selecting only one answer while others allow choosing multiple options for your answer. The exam duration is 2 hours, providing ample time to carefully consider questions and answer them calmly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparation
&lt;/h2&gt;

&lt;p&gt;The most important aspect is to thoroughly read the &lt;a href="https://docs.github.com/en/actions"&gt;documentation&lt;/a&gt;. While you may not remember everything you read, having read it once will still greatly benefit you. Additionally, it's crucial to follow the &lt;a href="https://github.blog/changelog/"&gt;changelog&lt;/a&gt;. GitHub posts weekly updates and news, which help to keep us up to date with any changes or new features.&lt;/p&gt;

&lt;p&gt;Looking solely at the exam scope, GitHub has launched modules on the &lt;a href="https://learn.microsoft.com/en-us/collections/n5p4a5z7keznp5"&gt;Microsoft Learn platform&lt;/a&gt;. I completed all the modules and found them very useful, I believe they may not be sufficient preparation on their own. Additionally, there are four domains that encompass all topics, as described in the &lt;a href="https://assets.ctfassets.net/wfutmusr1t3h/2mMJ6nECbUAdiQMTObbPw6/275fd49301e7a0d1b4e3de0bfe95d765/github-actions-exam-preparation-study-guide__1_.pdf"&gt;study guide&lt;/a&gt;. To simplify and aid in studying, I have divided the main topics and provided a description for each one.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Topic&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/learn-github-actions"&gt;Learn GitHub Actions&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Understanding expressions, context, and variables is essential for effectively utilizing GitHub Actions. These concepts provide flexibility and control within workflows, enabling dynamic configuration and efficient management of workflow behavior.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/using-workflows"&gt;Workflow&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The most important topic encompasses concepts related to workflow syntax, commands like &lt;a href="https://dev.to/rafael_svieira/github-actions-output-5ach"&gt;set output&lt;/a&gt;, and artifact management.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/using-jobs"&gt;Job&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Shows how to use jobs with conditional statements, matrix configurations, environments, and other features is essential for optimizing and customizing GitHub Actions workflows to meet specific requirements.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/using-containerized-services"&gt;Service container&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Concept about how to use service container into a job.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/publishing-packages"&gt;Publish Packages&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;An important topic that explains how publishing packages works in GitHub Packages.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/creating-actions"&gt;Custom actions&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;One of the most important topics discusses how to release and maintain a custom action.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/security-guides"&gt;Secrets&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Shows how secrets work.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/deployment"&gt;Deployment&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Explain the concept of deployments. There are some examples using various cloud providers, but the main focus is on understanding the concept, environments, and protection rules.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/hosting-your-own-runners"&gt;Self-hosted runner&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;There is a lot of information available about self-hosted runners, but it's important to understand the concept and benefits they offer.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/using-github-hosted-runners"&gt;Github-hosted runner&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Learn about the available labels and how GitHub-hosted runners function.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging"&gt;Enable debug logging&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A simple topic that explains how to use the debug mode.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.github.com/en/rest/repos/repos"&gt;Github API&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Finally, regarding APIs, you don't need to memorize every request/response, but it's important to understand the scope of requests. For instance, if you need to change some settings in the repository, you should be aware that the endpoint should include the owner and repo parameters, such as &lt;code&gt;https://api.github.com/repos/OWNER/REPO/&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Thorough preparation and understanding of key concepts are crucial for success in the GitHub Actions certification exam. Utilize resources like Microsoft Learn modules, comprehend essential topics using the documentation, create proofs of concept (POCs), and stay updated with GitHub's changelog for effective utilization in software development workflows.&lt;/p&gt;

</description>
      <category>githubactions</category>
      <category>github</category>
      <category>certification</category>
      <category>devops</category>
    </item>
    <item>
      <title>Github Actions - Output</title>
      <dc:creator>Rafael</dc:creator>
      <pubDate>Tue, 22 Aug 2023 19:44:14 +0000</pubDate>
      <link>https://dev.to/rafael_svieira/github-actions-output-5ach</link>
      <guid>https://dev.to/rafael_svieira/github-actions-output-5ach</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As &lt;strong&gt;workflows&lt;/strong&gt; are built and become more complex, there is a necessity to share information between &lt;strong&gt;steps&lt;/strong&gt;, &lt;strong&gt;jobs&lt;/strong&gt;, and even &lt;strong&gt;workflows&lt;/strong&gt; themselves.&lt;/p&gt;

&lt;p&gt;One of the most common ways to share values is by using &lt;strong&gt;GitHub&lt;/strong&gt; outputs, due to their simplicity and being a built-in feature of &lt;strong&gt;workflows&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;This material aims to explore the usage of outputs, their limitations, and best practices. Even though it's straightforward, caution should be exercised in certain aspects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Output between Steps
&lt;/h2&gt;

&lt;p&gt;The syntax to generate an output should follow the pattern:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo "&amp;lt;output_name&amp;gt;=&amp;lt;output_value&amp;gt;" &amp;gt;&amp;gt; $GITHUB_OUTPUT&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;One of the simplest examples is sharing between &lt;strong&gt;steps&lt;/strong&gt; within the same job.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
   &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 

&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
   &lt;span class="na"&gt;step-outputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
     &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt; 
     &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
       &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get runner name&lt;/span&gt; 
         &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;runner&lt;/span&gt; 
         &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt; 
           &lt;span class="s"&gt;echo "name=ubuntu-latest" &amp;gt;&amp;gt; $GITHUB_OUTPUT &lt;/span&gt;

       &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Show output&lt;/span&gt; 
         &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo ${{ steps.runner.outputs.name }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, we have two &lt;strong&gt;steps&lt;/strong&gt;: the first generates the output, and the second consumes it.&lt;/p&gt;

&lt;p&gt;The first &lt;strong&gt;step&lt;/strong&gt; has the attribute &lt;code&gt;id&lt;/code&gt; with the value &lt;code&gt;runner&lt;/code&gt;, allowing any other &lt;strong&gt;step&lt;/strong&gt; within the same job to consume the generated output.&lt;/p&gt;

&lt;p&gt;We can observe the consumption of the output in the second &lt;strong&gt;step&lt;/strong&gt; using the following syntax:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;${{ steps.&amp;lt;id_previous_step&amp;gt;.outputs.&amp;lt;output_name&amp;gt; }}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The result of the created workflow will display the value &lt;code&gt;ubuntu-latest&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jF-Fcs7_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzvyediubsfk5giucn1q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jF-Fcs7_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzvyediubsfk5giucn1q.png" alt="share output between steps" width="626" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Output between Jobs
&lt;/h2&gt;

&lt;p&gt;To share output between &lt;strong&gt;jobs&lt;/strong&gt;, it's necessary to add the &lt;code&gt;output&lt;/code&gt; property to the job that will generate the value.&lt;/p&gt;

&lt;p&gt;This property should contain the reference to the &lt;strong&gt;step&lt;/strong&gt; (as described above), and the job that will receive the value must have the &lt;strong&gt;needs&lt;/strong&gt; property with the name of the preceding job.&lt;/p&gt;

&lt;p&gt;Observe the example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;job-1&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;outputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;runner-name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.runner.outputs.name }}&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Set runner name&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;runner&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "name=ubuntu-latest" &amp;gt;&amp;gt; $GITHUB_OUTPUT&lt;/span&gt;
  &lt;span class="na"&gt;job-2&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;needs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;job-1&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Show job-1 output&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "Output job-1: ${{ needs.job-1.outputs.runner-name}}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Output with actions/core
&lt;/h2&gt;

&lt;p&gt;It's also possible to use output through the &lt;a href="https://github.com/actions/github-script"&gt;github-script&lt;/a&gt; action.&lt;/p&gt;

&lt;p&gt;This action is commonly used when integration with &lt;strong&gt;GitHub&lt;/strong&gt; is required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;job-actions-core&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/github-script@v6&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions-core&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
            &lt;span class="s"&gt;core.setOutput('result', 'core')&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;show output actions-core&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "${{ steps.actions-core.outputs.result }}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Not to Do
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Overwriting the GITHUB_OUTPUT Variable
&lt;/h3&gt;

&lt;p&gt;A common mistake to watch out for is overwriting the &lt;code&gt;GITHUB_OUTPUT&lt;/code&gt; variable within the same &lt;strong&gt;step&lt;/strong&gt;. If this happens, all previously saved outputs will be lost.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;job-output-overwrite&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Overwrite output&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;runner&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "name=ubuntu-latest" &amp;gt;&amp;gt; $GITHUB_OUTPUT&lt;/span&gt;
          &lt;span class="s"&gt;echo "so=linux" &amp;gt; $GITHUB_OUTPUT&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;show output&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo ${{ steps.runner.outputs.name }}&lt;/span&gt;
          &lt;span class="s"&gt;echo ${{ steps.runner.outputs.so }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bunE63NR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jvh5v6mi4dypwvez0r4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bunE63NR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jvh5v6mi4dypwvez0r4g.png" alt="show result overwrite output" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This occurs because the &lt;code&gt;GITHUB_OUTPUT&lt;/code&gt; variable has a file as a reference.&lt;/p&gt;

&lt;p&gt;Similar to the &lt;code&gt;/etc/environment&lt;/code&gt; file, the &lt;code&gt;GITHUB_OUTPUT&lt;/code&gt; file is loaded with each new &lt;strong&gt;step&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sharing Secrets
&lt;/h3&gt;

&lt;p&gt;Values stored in secrets cannot be shared as output between &lt;strong&gt;jobs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's assume there is a secret with the value &lt;code&gt;my-secret&lt;/code&gt;. To add a secret, simply follow the path &lt;code&gt;Settings &amp;gt; Secrets and variables &amp;gt; Actions &amp;gt; New repository secret&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xotpfS8M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7i0ymktizin0r2w0mj55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xotpfS8M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7i0ymktizin0r2w0mj55.png" alt="saving secret in repository settings" width="797" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's assign the secret to an output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;job-1-secret&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;outputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.step-1.outputs.value }}&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Set secret as output&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;step-1&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "value=${{ secrets.SECRET_OUTPUT }}" &amp;gt;&amp;gt; $GITHUB_OUTPUT&lt;/span&gt;

  &lt;span class="na"&gt;job-2-secret&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;needs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;job-1-secret&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Show output job-1-secret&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "Output with secret: ${{ needs.job-1-secret.outputs.value}}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Upon executing the workflow, the following warning will be received.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3jVGIRwc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ex3pi837r2rpqqxw0lcu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3jVGIRwc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ex3pi837r2rpqqxw0lcu.png" alt="Warning for sharing secret" width="800" height="116"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Deprecated Output
&lt;/h3&gt;

&lt;p&gt;The syntax below works, but it's deprecated and should not be used as we do not know when it will cease to function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;job-deprecated-output&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Output deprecated&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;runner&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo "::set-output name=name::ubuntu-latest"&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;show output&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo ${{ steps.runner.outputs.name }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Upon execution, the following warning can be observed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QIu5yX43--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ex2e8r4gcnslhfotki78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QIu5yX43--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ex2e8r4gcnslhfotki78.png" alt="deprecated output" width="800" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For more information, refer to the &lt;strong&gt;GitHub&lt;/strong&gt; post about &lt;a href="https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/"&gt;Deprecating save-state and set-output commands&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In summary, &lt;strong&gt;GitHub&lt;/strong&gt; workflows allow for sharing information between &lt;strong&gt;steps&lt;/strong&gt;, &lt;strong&gt;jobs&lt;/strong&gt;, and workflows through outputs. However, it's necessary to be mindful of potential syntax errors, value overwrites, and to stay informed about best practices for the tool by following the changelog.&lt;/p&gt;

</description>
      <category>githubactions</category>
      <category>cicd</category>
      <category>github</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
