<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Matt Cummings on Medium]]></title>
        <description><![CDATA[Stories by Matt Cummings on Medium]]></description>
        <link>https://medium.com/@mc999?source=rss-f28ebaffdb32------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*ObHoSEeT5q_hEZ_xxEfexg.jpeg</url>
            <title>Stories by Matt Cummings on Medium</title>
            <link>https://medium.com/@mc999?source=rss-f28ebaffdb32------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 18:06:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mc999/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Github Actions: Almost Everything You Need To Know About Outputs]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/github-actions-almost-everything-you-need-to-know-about-outputs-4c6ddeee36d5?source=rss-f28ebaffdb32------2"><img src="https://cdn-images-1.medium.com/max/1344/1*L3HER2xJDYoef4XoQaWDRQ.png" width="1344"></a></p><p class="medium-feed-snippet">Passing information between workflows</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/github-actions-almost-everything-you-need-to-know-about-outputs-4c6ddeee36d5?source=rss-f28ebaffdb32------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/github-actions-almost-everything-you-need-to-know-about-outputs-4c6ddeee36d5?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c6ddeee36d5</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[source-control-management]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 15:03:22 GMT</pubDate>
            <atom:updated>2026-04-27T15:03:22.839Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Triggering a Github Actions Workflow Without Merging Into The Default Branch: A Guide]]></title>
            <link>https://levelup.gitconnected.com/triggering-a-github-actions-workflow-without-merging-into-the-default-branch-a-guide-8a2265aba998?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a2265aba998</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github-cli]]></category>
            <category><![CDATA[github-repositories]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Mon, 02 Mar 2026 16:19:21 GMT</pubDate>
            <atom:updated>2026-03-02T16:19:21.891Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Alternate methods to the Github UI</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HwqM2T4R6ZWR5GVootRpdQ.jpeg" /></figure><h3>Introduction</h3><p>One of the easiest ways to trigger and test a <a href="https://medium.com/devops-dev/a-comprehensive-guide-to-creating-and-using-a-basic-github-app-for-token-management-via-0bfcfa39f5c1">Github Actions</a> workflow is via the <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow#running-a-workflow">Github Actions UI page</a>, which can only be done if that workflow is merged to repository’s default branch (usually main or master). A common supplementary approach to keep the default branch in a working state is merging the basic workflow skeleton into the repository’s default branch, iterating on this workflow in a feature branch, and running the workflow in the context of that feature branch.</p><p>However, that approach cannot be used all the time —there are inevitably going to be times you can’t merge into the default branch. How then, can you trigger a workflow you’re currently developing? This article explores various methods that go beyond the UI page, all of them <em>not</em> requiring the workflow being merged to the default branch.</p><h3>Scenario</h3><p>The organization <a href="https://github.com/org-mushroom-kingdom/">org-mushroom-kingdom</a> has a repository <a href="https://github.com/org-mushroom-kingdom/ttn-workflows">ttn-workflows</a> which is solely dedicated to workflows that can be used by the organization. This repository at the moment has a freeze on merging into main, the default branch.</p><p>A developer is developing a workflow that calls upon a script to send HTTP requests via cURL to various servers of interest. This work is still expected to be in active development even though the main branch is frozen. The developer only has experience using the approach outlined in the <strong><em>Introduction</em></strong> section above; it’s thus up to them to figure out how they can reliably trigger the workflow without being able to merge into main.</p><p>Luckily for them there’s plenty of ways to do this. Let’s dive right in!</p><h3>Setting Things Up</h3><p>There is a workflow in ttn-workflows named non-main-workflow.yml that has all the triggers that can be used to activate a workflow when it’s not merged to the default branch.</p><p>If you’re following along with this article, you’ll want to:</p><ul><li>Create your own feature branch and copy the non-main-workflow.yml workflow on it.</li><li>Create a personal access token since some triggers involve API usage.</li><li>Set up Postman to use as an API client and prep the payload.</li></ul><h4>Creating a Feature Branch with the Workflow</h4><p>We’ll refer to the feature branch you’ll be working with as your-feature-branch. You can choose to make this feature in your own repository or base it off of a forked copy of ttn-workflows. Instructions are provided for the latter:</p><ol><li>Fork the ttn-workflows repo.</li><li>Copy the .github/workflows/non-main-workflow.yml code somewhere or save it to a file.</li><li>In a commit, delete the .github/workflows/non-main-workflow.yml from the main branch.</li><li>Push this commit to main.</li><li>Make a new feature branch named your-feature-branch. Checkout this branch if this has not happened automatically.</li><li>Make a new file with the path .github/workflows/non-main-workflow.yml.</li><li>Paste in the code you copied from Step 2 into the .github/workflows/non-main-workflow.yml file.</li><li>Edit the code that was just pasted: Find all instances of the text feature/matt-test-workflow-without-main-merge. Except for the first instance (a comment near the top of the file), replace all instances with your-feature-branch</li><li>Save the file, and make a commit. (Note: This will trigger the workflow due to the push trigger present.)</li></ol><h4>Creating a Personal Access Token</h4><p>API calls that can be used to trigger the workflow need a personal access token to function. You can follow Github’s official instructions on how to make a personal access token <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic">here</a>. I used a classic personal access token for testing.</p><p>The classic token needs repo permissions for the call we’ll be making, so be sure to assign them upon token creation. Don’t forget to copy the token’s value once it has been created!</p><h4>Open Postman and Prepping the Payload</h4><p>As a good exercise and to make our API call more visually explicit, we’ll be using the <a href="https://www.postman.com/">Postman API client</a>.</p><p>To get some of our call set up, follow these instructions:</p><ol><li>Open Postman (I used the desktop version to test, but the browser version should be fine).</li><li>In the ttn-workflows repo, find the /docs/payload-for-non-main-workflow.json file, which serves as our payload. Copy its contents and paste them in the <em>Body</em> section of the Postman request.</li><li>Change the ref: in the payload to your-feature-branch</li></ol><p>More details about the API call will be covered in the <strong><em>workflow_dispatch</em></strong> section.</p><h3>Triggers</h3><p>The following triggers can be used to trigger a workflow that has not been merged into the default branch:</p><ul><li>push</li><li>pull_request</li><li>workflow_dispatch (either via API call or Github CLI)</li><li>workflow_call</li></ul><h4>Making the Workflow Runs Viewable in the Github Actions UI</h4><p>Before we discuss the triggers, note that if you’re coding alongside this article, be sure to check the Github Actions UI after every time you think you’ve triggered the workflow. Various workflow steps will give more details about how the workflow was triggered.</p><p>If you’ve followed along with this guide up to this point, the workflow will already be viewable in the Github Actions UI page due to the presence of the push trigger in the workflow. If you didn’t have the push trigger or commented it out, then the workflow will not be viewable. The general rule of thumb to make [the logs of] a workflow that is not merged into the default branch appear in the Github Actions UI is that the workflow must be run once. In other words, when you trigger the workflow, then you should be able to see its logs.</p><p>The general rule of thumb to make a workflow that is not merged into the default branch appear in the Github Actions UI is that the workflow must be run once. In other words, when you trigger the workflow, then you should be able to see its logs.</p><h3>push</h3><p>The push trigger is the easiest one to activate. Literally all you need to do is make a commit on your-feature-branch and push it. Note that you’ve already done this once, during the <strong><em>Creating a Feature Branch with the Workflow</em></strong> section.</p><p>You can add exclusivity to the push trigger via the paths key. This key will limit the scope of the push trigger based upon the paths (which are actually <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#patterns-to-match-branches-and-tags">glob patterns</a>) of the changed files in the commit.</p><p>For example, observe the following gist:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ef953abac4ef88d8c9cf2af7d1a5967/href">https://medium.com/media/9ef953abac4ef88d8c9cf2af7d1a5967/href</a></iframe><p>If paths is set up like the above code, then only commits to the workflow itself or a commit to any file in the docs/ directory will cause the workflow to fire. This kind of selectivity can be particularly useful if your branch has files you want to work on without triggering the workflow each time you make a commit.</p><h3>pull_request</h3><p>The pull_request trigger takes slightly more effort to activate than push, but not by much.</p><p>To get anywhere with this trigger, we’ll first have to create a pull request.</p><p>Follow these instructions to do so:</p><ol><li>Create a new feature branch based off of your-feature-branch. This new branch will be referred to as your-feature-branch-2</li><li>Make a commit with a small insignificant change on your-feature-branch-2</li><li>Open a pull request in the following manner:<br>base: your-feature-branch <br>compare: your-feature-branch-2<br>In other words, the source branch should be your-feature-branch-2and the target branch should be your-feature-branch</li></ol><p>Once the pull request has been created, this should trigger the workflow as this activity corresponds the opened activity type. See the below subsection for more information regarding activity types and different ways to activate the pull_request trigger.</p><h4>Activity Types</h4><p>The default activity types of pull_request are used: opened, synchronize, and reopened per <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request">official documentation</a>. You’ve already trigger the opened activity type since you created the pull request.</p><p>Now that the PR exists, you can activate the other types of pull_request trigger activity types:</p><p>- synchronize: While the PR is open, make a commit to the your-feature-branch-2, the source branch of the PR. (Note: This is the easiest of the three activity types to trigger)</p><p>- reopened: Close and reopen the PR</p><p>The Github Actions UI shows the activity type that was triggered in both the workflow runs page and on the individual workflow run, but personally I found it a little easy to miss. Thus, non-main-workflow.ymlhas a step “<em>Echo workflow trigger, activity type (if exists)</em>” that will tell you the specific activity type triggered via the following logic:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7273e33a43701df9c68a1f7a3b222bf2/href">https://medium.com/media/7273e33a43701df9c68a1f7a3b222bf2/href</a></iframe><p>github.event.action gives the value of the activity type that was triggered (Note: Only if the event uses activity types, not all events do). The code above is saying “<em>If there is an activity type (</em><em>github.event.action is NOT an empty string), then print it out and highlight it in yellow</em>”</p><h3>workflow_dispatch</h3><p>Typically, workflow_dispatch is most easily activated by interacting with the Github Actions UI. In this scenario, however, we don’t have the ability to do that. Luckily, workflow_dispatch has other ways it can be triggered that aren’t dependent on the workflow being merged to the default branch. These methods also allow for the use of inputs, which non-main-workflow.ymlutilizes.</p><h4>Inputs</h4><p>The workflow_dispatch inputs our workflow uses can be seen below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4a5f2d0e37a778046182d2e431bb604/href">https://medium.com/media/f4a5f2d0e37a778046182d2e431bb604/href</a></iframe><p>The notes and triggered-by-api inputs allow one to give more context into the specifics of how the workflow_dispatch was activated. The perform-server-check allows us to skip the actual business logic of the workflow if desired, since for this scenario we’re often more concerned with triggering the workflow itself rather than the execution of its code.</p><p>non-main-workflow.yml has a step “<em>workflow_dispatch: Read inputs</em>” that specifically shows the value of these inputs, which can be useful if you’re activating the workflow_dispatch event in different ways like we’re about to. You can even utilize the inputs to signify you’re activating workflow_dispatch via the Github UI if you decide to eventually merge into the default branch, making this step even more valuable.</p><h4>API call</h4><p>Using the <a href="https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event">Github API’s “Create a workflow dispatch event” endpoint</a> we can activate the workflow_dispatch trigger, complete with inputs.</p><p>Earlier, we opened Postman and set up our payload to prepare making this API call. Let’s take a closer look at all the parts needed using the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WKg_ZzubLeC-rjpS1ZF5Vg.png" /><figcaption>A collage of different screenshots of Postman. You may have to zoom in on this picture to see the details.</figcaption></figure><p><strong>HTTP Method</strong></p><p>Per the documentation our HTTP method must be of type POST.</p><p><strong>URL</strong></p><p>Our URL to make the call to follows the format of https://api.github.com/repos/&lt;OWNER&gt;/&lt;REPO&gt;/actions/workflows/&lt;WORKFLOW-FILENAME.yml&gt;/dispatches</p><p>&lt;OWNER&gt; is the owner of a specific repository, specified by &lt;REPO&gt;. The &lt;WORKFLOW-FILENAME.yml&gt; is the filename of the workflow to trigger.</p><p><strong>Authorization</strong></p><p>Our Authorization header must be of type Bearer (selectable in Postman’s <em>Auth Type</em> dropdown as <em>Bearer Token</em>). The value for this header is the token that was created earlier in the <strong><em>Setting Things Up: Creating a Personal Access Token</em></strong> section.</p><p><strong>Other Headers</strong></p><p>The other headers I used as part of the HTTP request are:</p><ul><li>Accept: application/vnd.github.v3+json</li><li>Content-Type: application/json</li></ul><p>I omitted the X-GitHub-Api-Version header to no ill effect for this scenario. That being said, you generally should use this header as a best practice per <a href="https://docs.github.com/en/rest/about-the-rest-api/api-versions?apiVersion=2022-11-28#specifying-an-api-version">official documentation</a>.</p><p><strong>Payload</strong></p><p>Observe the following gist. (It’s the payload you copied earlier.)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be8066b3d3848da0572ce8825e223c84/href">https://medium.com/media/be8066b3d3848da0572ce8825e223c84/href</a></iframe><p>The ref specifies what Git reference the workflow is associated with (this can be a branch or tag name). In my case, the branch I had my workflow on was feature/matt-test-workflow-without-main-merge.</p><p>The inputs hash is used to assign the values for the inputs described above. Basically, put together the values are saying “<em>This is an API call triggered by Postman, and I don’t want to invoke the server checking functionality.</em>”</p><h4>Github CLI</h4><p>If you have Github CLI installed, you can use it to trigger workflow_dispatch in a more succinct way. It’s important to note that <a href="https://cli.github.com/manual/gh_workflow_run">this Github CLI command</a> is essentially a wrapper around the Github API call above, just in a simpler, command-line based format.</p><p>For our scenario, the Github CLI command has the following structure:</p><pre>gh workflow run &lt;WORKFLOW-FILENAME.yml&gt; --ref &lt;ref-value&gt; -f &lt;input-name&gt;=&lt;input-value&gt;</pre><p>The &lt;WORKFLOW-FILENAME.yml&gt; is the filename of the workflow to trigger. The ref specifies what Git reference the workflow is associated with (ref-value can be a branch or tag name). The -f flag is a way to pass in an input: &lt;input-name&gt; is the name of the input, &lt;input-value&gt; is the value to give that input.</p><p>I used Git Bash to run the following Github CLI command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c6dccab0db0d30760d3842a7de81023/href">https://medium.com/media/3c6dccab0db0d30760d3842a7de81023/href</a></iframe><p>We specify our workflow to be non-main-workflow.yml, and the ref to be feature/matt-test-workflow-without-main-merge. For our notes input, we’ll put that this workflow is being triggered by Github CLI. Since the Github CLI is basically a wrapper for a Github API call, we’ll set triggered-by-api as true. For this test, we don’t care to do the server check, so we set perform-server-check as false.</p><p>In other words, the command is saying “<em>Use </em>workflow_dispatch<em> to trigger the </em>non-main-workflow.yml<em>workflow, specifically using the ref </em>feature/matt-test-workflow-without-main-merge<em>. When you trigger it, the </em>notes<em> should say this trigger was from Github CLI. Say that the workflow was triggered by API and don’t do the server check logic.</em>”</p><h3>workflow_call</h3><p>Technically, you can also use workflow_call to trigger a workflow that isn’t merged into the default branch. I can’t think of a reason why you’d use this approach over the others, but it is possible. Perhaps one such application would be using a caller workflow that has inputs for the reusable workflow name and ref it’s tied to. Regardless, we’ll explore how to use workflow_call to trigger our workflow.</p><p>The workflow_call trigger insinuates that the workflow is reusable. <a href="https://medium.com/devops-dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609">Reusable workflows</a> have a corresponding caller workflow. For this scenario, our caller workflow will be called non-main-workflow-caller.yml and it will already be present in ttn-workflows in the main branch.</p><p>If you’re coding along with this article, briefly switch your branch back to main, copy the code of the caller workflow <a href="https://github.com/org-mushroom-kingdom/ttn-workflows/blob/main/.github/workflows/non-main-workflow-caller.yml">here</a>, then commit and push.</p><h4>inputs</h4><p>Below is a gist of the workflow_call inputs of non-main-workflow.yml:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83d3373325f469f45e10b5f2757355bf/href">https://medium.com/media/83d3373325f469f45e10b5f2757355bf/href</a></iframe><p>perform-server-check functions exactly the same as it does in workflow_dispatch. The called-by-caller input is used to signify that non-main-workflow.yml was trigged by workflow call. This is done because <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#github-context">when a workflow functions as a reusable (called) workflow, the workflow uses the caller’s </a><a href="https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#github-context">github context</a>.</p><p>As seen above, we have steps that access the <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context">github context</a> in various ways to give us information as to how non-main-workflow.yml was triggered. We don’t want to get things confused, so we’ll leverage called-by-caller like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b8d48452fc5fd94543c6ccfb463338e/href">https://medium.com/media/5b8d48452fc5fd94543c6ccfb463338e/href</a></iframe><p>Basically, for both steps we assess if called-by-caller is true and determine our output based off that. This helps keep things clear as to how non-main-workflow.yml was triggered.</p><p>The non-main-workflow-caller.yml workflow has a workflow_dispatch event with the same inputs as above.</p><h4>Setting Up the Caller Workflow Job</h4><p>Our caller workflow job is pretty simple, triggerable via workflow_dispatch. The “<em>Non-main workflow caller Job</em>” job utilizes the <a href="https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows">uses keyword to specify the workflow</a> to call (the text after the @ signifies what ref that workflow is located on) and with to specify values for the inputs</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b9a440f7508dd155573db8c740257dc/href">https://medium.com/media/6b9a440f7508dd155573db8c740257dc/href</a></iframe><h4>Triggering</h4><p>To trigger non-main-workflow.ymlvia workflow_call, we’ll take advantage of the fact that non-main-workflow-caller.yml has a workflow_dispatch event and is merged in the default branch — we can just use the Github Actions UI to navigate to and fire it (you probably miss doing this by now)!</p><p>Looking at the workflow log when non-main-workflow.yml is triggered via workflow_call is different — you need to look at the runs for non-main-workflow-caller.yml, not non-main-workflow.yml.</p><p>The caller workflow has two jobs, the first job (“<em>Echo inputs</em>”) you can just straight up ignore. The second job (“<em>Non-main workflow caller Job</em>”) is what we’re interested in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NSOaWPZtXXDtyY6G-OJ3g.png" /><figcaption>Using a caller workflow to trigger</figcaption></figure><p>The workflow run when this job is highlighted looks pretty much the same, except with some additional content in the highlighted step to inform the reader that non-main-workflow.ymlwas triggered by workflow_call.</p><p>With that, you’ve performed all the different ways you can trigger a workflow that hasn’t been merged to the default branch. Congratulations!</p><h3>Conclusion</h3><p>At this point you have read about various ways to trigger a workflow that has not been merged to the default branch, and maybe even tested these different methods yourself. You’ve seen that different options allow for different flexibilites, such as the paths key for push and pull_request or inputs for workflow_dispatch and workflow_call. With this knowledge, you can confidently develop and trigger workflows in ways other than the Github UI, and choose the best fit for your use case. So long, and have fun experimenting!</p><h3>Sources</h3><p>Links present in the article are listed here generally in order of appearance.</p><p>Please note the following:</p><ul><li>Some links may be present more than once in the article. To keep things brief, only the first instance is listed.</li><li>A # present in the title of the source indicates a bookmark on that page unless otherwise indicated.</li></ul><ol><li>“Getting Started With Github Actions”, <em>Medium (DevOps.dev)</em>: <a href="https://blog.devops.dev/getting-started-with-github-actions-05ca591797a5">https://blog.devops.dev/getting-started-with-github-actions-05ca591797a5</a></li><li>“Manually running a workflow”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow?tool=webui">https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow?tool=webui</a></li><li>“org-mushroom-kingdom”, <em>Github repository</em>: <a href="https://github.com/org-mushroom-kingdom">https://github.com/org-mushroom-kingdom</a></li><li>“ttn-workflows”, <em>Github repository</em>: <a href="https://github.com/org-mushroom-kingdom/ttn-workflows">https://github.com/org-mushroom-kingdom/ttn-workflows</a></li><li>“Managing your personal access tokens #Creating a personal access token (classic)”, <em>Github</em>: <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic">https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic</a></li><li>“Postman: The World’s Leading API Platform”, <em>Postman homepage</em>: <a href="https://www.postman.com/">https://www.postman.com/</a></li><li>“Workflow syntax for GitHub Actions #Patterns to match branches and tags”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#patterns-to-match-branches-and-tags">https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#patterns-to-match-branches-and-tags</a></li><li>“Events that trigger workflows #pull_request”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request">https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request</a></li><li>“REST API endpoints for workflows #Create a workflow dispatch event”, <em>Github</em>: <a href="https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event">https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event</a></li><li>“API Versions #Specifying an API version”, <em>Github</em>: <a href="https://docs.github.com/en/rest/about-the-rest-api/api-versions?apiVersion=2022-11-28#specifying-an-api-version">https://docs.github.com/en/rest/about-the-rest-api/api-versions?apiVersion=2022-11-28#specifying-an-api-version</a></li><li>“gh workflow run”, <em>Github CLI</em>: <a href="https://cli.github.com/manual/gh_workflow_run">https://cli.github.com/manual/gh_workflow_run</a></li><li>“Github Actions: Creating, Calling, and Testing a Reusable Workflow”, <em>Medium</em>: <a href="https://blog.devops.dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609">https://blog.devops.dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609</a></li><li>“non-main-workflow-caller.yml”, <em>Github repository file</em>: <a href="https://github.com/org-mushroom-kingdom/ttn-workflows/blob/main/.github/workflows/non-main-workflow-caller.yml">https://github.com/org-mushroom-kingdom/ttn-workflows/blob/main/.github/workflows/non-main-workflow-caller.yml</a></li><li>“Reusing workflow configurations #github context”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#github-context">https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#github-context</a></li><li>“Contexts reference #github context”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context">https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*MUuKhUCoWRK4nRPNGgFZjw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a2265aba998" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/triggering-a-github-actions-workflow-without-merging-into-the-default-branch-a-guide-8a2265aba998">Triggering a Github Actions Workflow Without Merging Into The Default Branch: A Guide</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Comprehensive Guide to Creating and Using a Basic Github App for Token Management via…]]></title>
            <link>https://blog.devops.dev/a-comprehensive-guide-to-creating-and-using-a-basic-github-app-for-token-management-via-0bfcfa39f5c1?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bfcfa39f5c1</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[security-token]]></category>
            <category><![CDATA[github-app]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 15:01:10 GMT</pubDate>
            <atom:updated>2026-02-15T15:01:10.078Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Comprehensive Guide to Creating and Using a Basic Github App for Token Management via Installation Access Tokens in Workflows</h3><p><em>An alternative to personal access tokens</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ayittEexouwp6mwxd_-t3A.jpeg" /></figure><h3>Introduction</h3><p><a href="https://medium.com/devops-dev/getting-started-with-github-actions-05ca591797a5">Github Actions</a> workflows often require the use of tokens. If you’re lucky, you can use the built-in <a href="https://docs.github.com/en/actions/tutorials/authenticate-with-github_token">GITHUB_TOKEN</a> for some or even all of your needs, depending on what your workflows are doing. However, there are many times when that isn’t the case.</p><p>For example, say you have a caller workflow in one repository, and a corresponding reusable workflow in another (if you’re not familiar with caller and reusable workflows, feel free to refer to <a href="https://medium.com/devops-dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609">a previous article I wrote on the subject</a>). The reusable workflow references a file within its own repository to do some of its work, meaning that repository must be checked out. Because <a href="https://docs.github.com/en/actions/concepts/security/github_token#about-the-github_token">GITHUB_TOKEN is scoped to the repository of the workflow that was triggered initially</a> (the caller workflow), you have to instead create a <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens">personal access token</a>.</p><p>Management of personal access tokens <a href="https://dev.to/sramek5/github-personal-access-tokens-ol3">can be difficult for a myriad of reasons</a>, especially as projects get larger. Github Apps serve as a way to mitigate some of this token management through the use of another kind of token known as an <a href="https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app#about-installation-access-tokens">installation access token</a>.</p><p>This article reviews how to create and use an installation access token via a Github App and use that token in a workflow. It serves as a one-stop shop: Setup of a basic Github App is covered, as well as installing it on a repository. Instructions on how to generate a private key for the App and store it as a secret are reviewed, as well as following a similar process to set the Github App ID as a repository configuration variable. Lastly, how to use the actions/create-github-app-installation-token action to generate a token and the subsequent use of that token in a workflow is shown. All in one article!</p><p>To really get this knowledge to sink in, try coding along with this guide. Note that for the best experience, you should have admin permissions for the repositories you’re working with.</p><p>One last thing: be sure to check out the links scattered throughout this article as they were all used to help construct this beast. The <strong><em>Sources</em></strong> section at the end contains an index of all the links used.</p><h3>Scenario</h3><p>The organization <a href="https://github.com/org-mushroom-kingdom/">org-mushroom-kingdom</a> has an app “Toad Town News” which has repositories for the app frontend (<a href="https://github.com/org-mushroom-kingdom/ttn-frontend">ttn-frontend</a>) and backend (<a href="https://github.com/org-mushroom-kingdom/ttn-backend">ttn-backend</a>), as well as a repository dedicated to reusable workflows (<a href="https://github.com/org-mushroom-kingdom/ttn-workflows">ttn-workflows</a>).</p><p>The ttn-frontend repository is practicing some work with Github Actions. They already have a <a href="https://medium.com/devops-dev/github-actions-checking-out-and-utilizing-a-reusable-workflows-repository-992adbe7b3ae">caller workflow whose corresponding reusable workflow that requires a personal access token since another repository must be checked out</a>. Devs have started to bring up concerns with personal access tokens, citing things like having to keep track of expirations and subsequent regeneration of the tokens. Another concern is that in audit logs, it is often difficult to tell if a user tied to a personal access token actually performed a given activity or the token was used to perform it.</p><p>One developer poked around for a solution to this problem: utilizing a Github App. Github Apps can be used for several things, one of the most basic being generation of a special kind of token known as an <a href="https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app#about-installation-access-tokens">installation access token</a>. Installation access tokens are short-lived, transient tokens that inherit permissions granted to the Github App. They’re “non-personal” in that their activity is on behalf of the Github App and not tied to a user. It’s a perfect solution for the team!</p><p>The developers want to utilize a Github App to generate and use an installation access token to access a file on the reusable workflow’s repository. One dev creates article-titles-1–22–26.txt, a sample file with article titles and stores it in ttn-workflows. The goal is to just use <a href="https://serveracademy.com/blog/the-linux-cat-command/">Bash </a><a href="https://serveracademy.com/blog/the-linux-cat-command/">cat</a> to print the contents of that file — seeing that in the workflow run means the installation access token was made successfully and able to be used to checkout the repository.</p><h3>Registering a Github App on Your Personal Account</h3><p>For this scenario, a developer is going to use their personal account to register the Github App (Note that you can register an App from an organization admin account as well, as well as transfer ownership of an an app from your personal account to the organization. Be sure to refer to the <a href="https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app">official documentation on Github App creation</a> as needed).</p><p>To register the Github App for this scenario, follow these instructions:</p><p>Note: For this scenario, since this App is just for creating tokens, I chose to leave everything after <em>Homepage URL</em> up to right before <em>Permissions</em> as the default value.</p><p>1. In you web browser, login to Github and navigate to your profile settings.</p><p>2. Hit <em>Developer Settings</em>, which takes you to a new page.</p><p>3. Hit <em>Github Apps</em> in the left sidebar if not already selected. Then hit <em>New Github App</em>. (You may be prompted to enter your credentials again).</p><p>4. You will now be on the <em>Create GitHub App</em> page. Start off by entering a name in the <em>Github App name</em> section. For this scenario, we’ll name the app ttn-workflows-gh-app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rJFQq-eZnsMQpC0fNRI16A.png" /></figure><p>Note: This name must be unique from all other registered Github Apps in existence as it will be used as part of the URL for the App’s public page. You will see a message if your app name is not unique.</p><p>5. In the <em>Write</em> section, put a brief description of the purpose of the app. You may also wish to list the permissions the app has. For an example, see <a href="https://github.com/apps/ttn-workflows-gh-app">this page</a>.<br>Note: This description supports markdown in the event text formatting is desired.</p><p>6. Put in a value for the <em>Homepage URL</em>. If you do not have a URL specifically for the app, <a href="https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app#registering-a-github-app">Github documentation recommends you put a link to a public repository that stores the code for the app, or a link to the app’s owner</a>. For this scenario, I am going to put org-mushroom-kingdom’s URL since it will be the eventual owner of the App.</p><p>7. Jump to the <em>Permissions</em> section. Expand the <em>Repository permissions</em> section. Locate <em>Contents</em> and in the dropdown next to it, select <em>Read-only</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VkKmtaxgQTciyAsTEsBHPw.png" /></figure><p>Note: Performing this action will automatically set the <em>Metadata</em> permission to <em>Read-only</em>. Also, you may have noticed I gave my App <em>Pull requests: Read-only</em> permission — If you’re following along you don’t need to grant that permission.</p><p>8. Under the <em>Where can this GitHub App be installed?</em> option, select <em>Any account.</em></p><p>9. Hit the <em>Create Github App</em> button.</p><p>At this point you have created that and you will be taken to the <em>Developer Settings</em> page for that App. You will notice a prompt to create a private key for it. This leads us into the next section.</p><h3>Setting Up and Storing the Private Key As a Repository Secret</h3><p>The private key is needed to make requests to the Github API on behalf of the app. In particular, <a href="https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps#about-private-keys-for-github-apps">per official documentation you need a private key request an installation access token</a>. The following subsections will go over how to generate a key as well as set it up as a repository secret. (Be sure to refer to the official documentation on <a href="https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps#generating-private-keys">setting up private keys</a> and <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-a-repository">storing repository secrets</a> as needed.)</p><h4>Generating a Private Key</h4><p>The instructions to generate a private key are as follows:</p><p>1. Assuming you are following along and just completed the section above, you can just click the blue text in the message that appears after App registration (see screenshot below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*eGKG6UiwVOUN1K7Lvqp2Qg.png" /></figure><p>If for some reason you had to navigate to a different page, no worries. The link shown above is just a bookmark to a section within the App’s settings page — you can just go the <em>Developer Settings</em> page for that App and scroll to the <em>Private Key</em> section.</p><p>2. Click the <em>Generate a private key</em> button. This creates and downloads a .pem file to your system.</p><p>3. Open the .pem file in a text editor and copy its contents.</p><h3>Storing the Private Key In A Repository</h3><p>Private keys must be stored as secrets at the repository or organization level to be properly utilized. In this scenario, the ttn-frontend repo needs a secret set up in order to properly generate the installation access token. Thus, the following instructions are from a repository-based perspective, but <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-an-organization">setting up a secret in an organization follows almost the exact same process</a>.</p><p>To store the private key as a secret in a repository for this scenario:</p><p>Note: You will need administrative privileges on the repository to create the repository secret.</p><p>1. Navigate to the <em>Settings</em> page of the repository. (For this scenario, this will be ttn-frontend).</p><p>2. In the left sidebar, under <em>Security</em>, click the <em>Secrets and variables</em> dropdown. Once the dropdown has expanded, click <em>Actions</em>.</p><p>3. In the <em>Repository secrets</em> section, click <em>New repository secret</em>.</p><p>4. In the <em>Name</em> field, give a name to the secret. I decided to go with the name TTN_WORKFLOWS_GH_APP_PRIVATE_KEY.</p><p>5. In the <em>Secret</em> field, paste in the entire contents of the .pem file that was mentioned in the subsection above. Your end result should look something like the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1g0YUFEg3aCVJIPj-bK-dQ.png" /><figcaption>I’m not foolish enough to actually put the real value of my private key in a screenshot. But you <em>could</em> Base64-decode what’s here to see a secret message if you were bored.</figcaption></figure><p>6. Hit the <em>Add secret</em> button.</p><p>Now our caller workflow ttn-frontend is set up to pass this secret over to the reusable workflow in ttn-workflows. We’re also going to store the Github App ID as a repository variable in ttn-frontend to follow best practices.</p><h3>Storing the Github App ID as a Repository Variable</h3><p>It is a generally recommended practice to store the Github App’s ID as <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-variables">a Github configuration variable</a>. In this scenario, we’ll store it at the repository level in ttn-frontend. It’s very similar to setting a secret; reference the <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-variables#creating-configuration-variables-for-a-repository">official documentation for setting Github configuration variables</a> as a supplement to the below instructions.</p><p>To set the Github App ID as a repository variable for this scenario:</p><p>1. Navigate to the <em>Developer Settings</em> page for the App.</p><p>2. You should have <em>General</em> highlighted in the left sidebar. Click it if this is not the case for whatever reason.</p><p>3. In the <em>About</em> section at the top of the page, you can see the App ID. Copy that value to your clipboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J1AvrFBVM7oxKZOBqsgjug.png" /><figcaption>Note: This is an edited screenshot — there is an actual number that will be present instead of the &lt;App ID here&gt; text.</figcaption></figure><p>4. Navigate to the repository of interest’s (ttn-frontend) Settings page.</p><p>5. In the left sidebar, under <em>Security</em>, click the <em>Secrets and variables</em> dropdown. Once the dropdown has expanded, click <em>Actions</em>.</p><p>6. Hit the <em>Variables</em> tab to access the repository variables. In the <em>Repository variables</em> section, hit the <em>New repository variable</em> button (see screenshot).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJc1tHM2RLnsbBcDOFYb0g.png" /></figure><p>7. In the <em>Name</em> text box, put a name for the variable. In this scenario, we will use the name TTN_WORKFLOWS_GH_APP_ID.</p><p>8. In the <em>Value</em> text area, paste the App ID you copied in step 3.</p><p>9. Hit the <em>Add variable</em> button.</p><p>Now we’ll be able to reference the App ID via the vars context when the time comes. The next thing we need to do is install the Github App on ttn-workflows so it can be used to generate installation access tokens.</p><h3>Installing the App on an Organization’s Repository</h3><p>In order to utilize the App we just created, it must be installed somewhere. For our scenario, this would be the ttn-workflows repository. Note that the terms “Github App” and “Github App installation” are similar, but not the same. See the optional section <strong><em>Github App vs Github App Installation</em></strong> for more details.</p><p>To set up a Github App installation in a repository for this scenario:</p><p>Note: For organizations, you do not necessarily need to be the organization owner to install the Github App on an organization’s repository. <a href="https://github.com/orgs/community/discussions/109332">Repository admins should be able to install the Github App, provided the App does not have any organization or admin permissions</a>.</p><p>1. Navigate to the <em>Developer Settings</em> page for the App.</p><p>2. In the left sidebar, click <em>Install App</em>.</p><p>3. Any account or organization you are the owner of should appear (see screenshot below). For this scenario, we will choose org-mushroom-kingdom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ux5aY8M7q0ecECASPs26A.png" /></figure><p>4. You are then prompted to choose all repositories or select repositories. For this scenario, I only need the App installed on ttn-workflows, so I’ll hit the <em>Only select repositories</em> bullet and search for it (see screenshot).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*UJG66XDiuLwCLjjNOugA1A.png" /></figure><p>5. You will then be taken to the page for the installation. It gives a summary of what you set up in previous steps. Seeing this page is a good sign and signifies the App installation was successful.</p><p>Now that we’ve installed the app somewhere, we can finally leverage it to create the installation access token. If you’re interested in clarifying what a Github App vs. Github App installation is, proceed to the following optional section. If you want to jump ahead and generate the installation access token, skip to the <strong><em>actions/create-github-app-installation-token</em></strong> section.</p><h3>Github App vs Github App Installation</h3><p>Note: This section is optional.</p><p>If you have read other discussions or documentation regarding Github Apps, you probably have seen the term “Github App installation” or something similar. An installation is related to a Github App but not exactly the same thing. A brief explanation of how these terms contrast is that a “Github App” is the definition of the application, whereas an installation is an instance of the Github App.</p><p>Elaborating upon that explanation, a “Github App” is sometimes synonymous with the App’s definition: an application located on Github that has various qualities like permissions and webhooks that ingest data. An installation is a working instance of that App, giving you access to it. That access is scoped to wherever you made the installation. At least, that is the general consensus based on <a href="https://octokitnet.readthedocs.io/en/latest/github-apps/?utm_source=chatgpt.com">surrounding</a> <a href="https://github.com/github-developer/github-apps-cheat-sheet?tab=readme-ov-file#key-concepts">documentation</a> I’ve read building up to this article.</p><h3>actions/create-github-app-installation-token</h3><p>Now that we’ve set up the overhead for our App, we can finally generate and use installation access tokens in our workflows! To do so, we call upon the aptly-named official Github Action <a href="http://actions/create-github-app-token">actions/create-github-app-token</a>.</p><h4>Creating the Installation Access Token</h4><p>Observe the following gist, taken from the reusable workflow get-article-titles.yml in ttn-workflows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8cb30406d39c679c720e1bb14a2b46d0/href">https://medium.com/media/8cb30406d39c679c720e1bb14a2b46d0/href</a></iframe><p>Let’s break down the tags being used in the above step:</p><ul><li>The id tag is used because this step will add a token to our <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job-outputs">workflow outputs</a>.</li><li>The uses tag is used to reference an external action (actions/create-github-app-token).</li><li>The with tag is used to provide inputs to that external action.</li><li>The app-id tag is our App ID we saved using a repository variable (Note: This is from the caller workflow, and is an example of how the vars context of the caller repository can be accessed by the reusable workflow. It would be more appropriate to use an input rather than reference the vars context directly, but I wanted to see if doing so would work.)</li><li>The private-key tag is the private key we saved as a repository secret</li><li>The owner tag is the owner of the Github App installation, which would be the organization org-mushroom-kingdom, which owns the ttn-workflows repository where our App is installed.</li><li>The repositories tag lists the repositories to grant access to. We want to use the token to access the ttn-workflows repository so we use it as the value.</li></ul><h4>Using the Installation Access Token</h4><p>As mentioned in the previous subsection, actions/create-github-app-tokenwrites the token as a workflow output. To utilize the output, all we need to do is reference it.</p><p>Observe the following gist from our reusable workflow. This step follows immediately after the token generation step.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e0bf37c8896c0bc17731fd691923c21/href">https://medium.com/media/4e0bf37c8896c0bc17731fd691923c21/href</a></iframe><p>We use <a href="http://xn--article-titles-12226-ju2lc.txt/">actions/checkout</a> to checkout the ttn-workflows repository into its own directory in GITHUB_WORKSPACE (as specified by the path key) on the runner, using steps.app-token.outputs.token to reference the installation access token made in the previous step. (Note the use of persist-credentials here: it’s set to false here as a security best practice.)</p><p>A step after this (not pictured) uses Bash cat to read the contents of the article-titles-1–22–26.txt file in that repo via referencing the directory it’s checked out to. Let’s ensure that’s the case by testing everything out!</p><h3>Testing</h3><p>To keep things simple, we’ll just add the workflow_dispatch trigger to our <em>caller</em> workflow so it can be manually triggered. Remember, the whole point here is to call out to the reusable workflow, checkout its repository with our installation access token, and verify we can do something with a file in that repository once it’s been checked out. (In actuality, you should test the reusable workflow independently as well, but for this scenario we can assume that has already been done).</p><p>Take a look at the caller workflow, get-article-titles-caller.yml:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4d71902082fd1ac656d0c3d5a889fc0/href">https://medium.com/media/b4d71902082fd1ac656d0c3d5a889fc0/href</a></iframe><p>It’s very simple: all it does is call the reusable workflow, passing in the private key secret we set up earlier.</p><p>We can <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow?tool=webui">trigger the caller workflow manually via the Github Actions UI</a>. From there, we can investigate the workflow run that results, focusing on our Bash cat step:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-4TF6j9bUiiCC7pXMaQB_Q.png" /><figcaption>A workflow run in ttn-frontend shows article titles being printed out from the article-titles-1–22–26.txt file on the reusable workflow’s repository.</figcaption></figure><p>Seeing these article titles means everything is working: our App made the token and used it to checkout a repository and access this file!</p><h3>Conclusion</h3><p>At this point, you have seen quite a bit: the process of registering and installing a Github App, generating a private key and storing it as a secret, setting the App ID as a repository variable, how to utilize the App to generate installation access tokens with actions/create-github-app-installation-token in a workflow, and finally using that token to perform a repository checkout.</p><p>You’ve also learned the benefits of using installation access tokens over personal access tokens, that they’re not tied to a user and have a transient, automated existence rather than going through manual processes to set all that up. While they won’t <em>completely</em> mitigate token-related headaches in repositories, they can be a much more efficient alternative.</p><p>Now that you’ve got some the base knowledge (along with a Github App and properly set up repositories, if you’ve been coding along), you can begin to experiment with installation access tokens on your own and start to move on to more advanced cases, like using the same Github App installation to generate tokens with different permissions. This is also a great time to assess what PATs can be done away with. Go forth, adventure awaits — you’ve literally got the (private) keys to the kingdom!</p><h3>Sources</h3><p>Links present in the article are listed here generally in order of appearance.</p><p>Please note the following:</p><ul><li>Some links may be present more than once in the article. To keep things brief, only the first instance is listed.</li><li>A # present in the title of the source indicates a bookmark on that page unless otherwise indicated.</li></ul><ol><li>“Getting Started With Github Actions”, <em>Medium (DevOps.dev)</em>: <a href="https://blog.devops.dev/getting-started-with-github-actions-05ca591797a5">https://blog.devops.dev/getting-started-with-github-actions-05ca591797a5</a></li><li>“Use GITHUB_TOKEN for authentication in workflows”, <em>Github</em>: <a href="https://docs.github.com/en/actions/tutorials/authenticate-with-github_token">https://docs.github.com/en/actions/tutorials/authenticate-with-github_token</a></li><li>“Github Actions: Creating, Calling, and Testing a Reusable Workflow”, <em>Medium</em>: <a href="https://blog.devops.dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609">https://blog.devops.dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609</a></li><li>“GITHUB_TOKEN: #About the GITHUB_TOKEN”, <em>Github</em>: <a href="https://docs.github.com/en/actions/concepts/security/github_token#about-the-github_token">https://docs.github.com/en/actions/concepts/security/github_token#about-the-github_token</a></li><li>“Managing your personal access tokens: #About personal access tokens”, <em>Github</em>: <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens">https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens</a></li><li>“GitHub: Personal Access Tokens”, <em>Dev.to</em>: <a href="https://dev.to/sramek5/github-personal-access-tokens-ol3">https://dev.to/sramek5/github-personal-access-tokens-ol3</a></li><li>“Generating an installation access token for a GitHub App: #About installation access tokens”, <em>Github</em>: <a href="https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app#about-installation-access-tokens">https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app#about-installation-access-tokens</a></li><li>“org-mushroom-kingdom”, <em>Github organization page</em>: <a href="https://github.com/org-mushroom-kingdom">https://github.com/org-mushroom-kingdom</a></li><li>“ttn-frontend”, <em>Github repo</em>: <a href="https://github.com/org-mushroom-kingdom/ttn-frontend/">https://github.com/org-mushroom-kingdom/ttn-frontend/</a></li><li>“ttn-backend”, <em>Github repo</em>: <a href="https://github.com/org-mushroom-kingdom/ttn-backend/">https://github.com/org-mushroom-kingdom/ttn-backend/</a></li><li>“ttn-workflows”, <em>Github repo</em>: https://github.com/org-mushroom-kingdom/ttn-workflows</li><li>“Github Actions: Checking Out And Utilizing a Reusable Workflow’s Repository”, <em>Medium (DevOps.dev)</em>: <a href="https://blog.devops.dev/github-actions-checking-out-and-utilizing-a-reusable-workflows-repository-992adbe7b3ae">https://blog.devops.dev/github-actions-checking-out-and-utilizing-a-reusable-workflows-repository-992adbe7b3ae</a></li><li>“Introduction to the cat Command”, <em>Server Academy</em>: <a href="https://serveracademy.com/blog/the-linux-cat-command/">https://serveracademy.com/blog/the-linux-cat-command/</a></li><li>“Registering a GitHub App”, <em>Github</em>: <a href="https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app">https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app</a></li><li>“ttn-workflows-gh-app” <em>Github app public page</em>: <a href="https://github.com/apps/ttn-workflows-gh-app">https://github.com/apps/ttn-workflows-gh-app</a></li><li>“Managing private keys for GitHub Apps: #About private keys for GitHub Apps” <a href="https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps#about-private-keys-for-github-apps">https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps#about-private-keys-for-github-apps</a></li><li>“Managing private keys for GitHub Apps: #Generating private keys”, <em>Github</em>: <a href="https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps#generating-private-keys">https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps#generating-private-keys</a></li><li>“Using secrets in GitHub Actions: #Creating secrets for a repository”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-a-repository">https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-a-repository</a></li><li>“Store information in variables”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-variables">https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-variables</a></li><li>“Install GitHub app on repo as an admin but not org owner #109332”, <em>Github community</em>: <a href="https://github.com/orgs/community/discussions/109332">https://github.com/orgs/community/discussions/109332</a><br>* Note the # here does not signify a bookmark.</li><li>“Working with GitHub Apps”, <em>Octokit.net Documentation</em>: <a href="https://octokitnet.readthedocs.io/en/latest/github-apps/">https://octokitnet.readthedocs.io/en/latest/github-apps/</a></li><li>“🤖 GitHub Apps Cheat Sheet ✨: #Key concepts”, <em>Github repo</em>: <a href="https://github.com/github-developer/github-apps-cheat-sheet?tab=readme-ov-file#key-concepts">https://github.com/github-developer/github-apps-cheat-sheet?tab=readme-ov-file#key-concepts</a></li><li>“create-github-app-token”, <em>Github repo</em>: <a href="https://github.com/actions/create-github-app-token">https://github.com/actions/create-github-app-token</a></li><li>“Passing information between jobs”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job-outputs">https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job-outputs</a></li><li>“checkout”, <em>Github repo</em>: <a href="https://github.com/actions/checkout">https://github.com/actions/checkout</a></li><li>“Manually running a workflow”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow?tool=webui">https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow?tool=webui</a><br>* Note: Make sure you are on the <em>Web browser</em> tab.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*MUuKhUCoWRK4nRPNGgFZjw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bfcfa39f5c1" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/a-comprehensive-guide-to-creating-and-using-a-basic-github-app-for-token-management-via-0bfcfa39f5c1">A Comprehensive Guide to Creating and Using a Basic Github App for Token Management via…</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Github Actions: Checking Out And Utilizing a Reusable Workflow’s Repository]]></title>
            <link>https://blog.devops.dev/github-actions-checking-out-and-utilizing-a-reusable-workflows-repository-992adbe7b3ae?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/992adbe7b3ae</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[github-repositories]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github-workflow]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Wed, 28 Jan 2026 14:46:01 GMT</pubDate>
            <atom:updated>2026-01-28T14:46:01.539Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Managing flows between different repositories</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*lKMEm-tR_jJg8b4K22iS4Q.jpeg" /><figcaption>A phone switchboard operator. Because we’re SWITCHING between repositories. Get it?</figcaption></figure><h3>Introduction</h3><p>Github Actions are designed to have various levels of reusability, such as <a href="https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action">composite actions</a> or <a href="https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows">reusable workflows</a>. A common approach to storing these items is having them contained in a separate repository, including tangential items related to them, such as scripts.</p><p>This article explores how a caller workflow reaches out to a reusable workflow and checks out its repository to execute a script to perform some basic logic. It’s a guide but not in a step-by-step format. However, you can follow along with the code this article is based on via the various repository links provided in the <strong><em>Scenario</em></strong> section below (in particular, the README in the ttn-workflows repository is very thorough for some reason — I must have been in the mood for documentation).</p><p>Be sure to check out the other links as well —for your convenience, they are all listed in the <strong><em>Sources</em></strong> section at the end of this article.</p><h3>Scenario</h3><p>The organization <a href="https://github.com/org-mushroom-kingdom/">org-mushroom-kingdom</a> has recently begun work on a news application “Toad Town News.” The work for this application has broken up into three repositories:</p><ul><li><a href="https://github.com/org-mushroom-kingdom/ttn-frontend">ttn-frontend</a>, which handles the frontend of the application.</li><li><a href="https://github.com/org-mushroom-kingdom/ttn-backend">ttn-backend</a>, which handles the backend of the application.</li><li><a href="https://github.com/org-mushroom-kingdom/ttn-workflows">ttn-workflows</a>, a repository dedicated to reusable workflows and items related to them such as scripts.</li></ul><p>The senior devs of this application have decided that any major frontend or backend release must have a pull request that includes a changelog file (hereafter referred to as a CHANGELOG file to match how it’s referred to in the above repositories’ code/documentation). This file gives the summary of the major changes associated with that release.</p><p>This CHANGELOG file has strict conventions surrounding it: there must exactly one CHANGELOG file present per release branch. Furthermore, this file must meet certain naming conventions.</p><p>When a pull request in ttn-frontend or ttn-backend is opened whose source branch is a release branch (a branch that begins with the string &quot;release&quot;) and whose target branch is main, a caller workflow is activated. This caller workflow calls a reusable workflow (changelog-quality-checks.yml, full path .github/workflows/changelog-quality-checks.yml) in the ttn-workflows repository that when triggered will check if the release branch meets the expected CHANGELOG file criteria.</p><p>Some of changelog-quality-checks.yml’s work is performed by a script (changelog-quality-checks.py, full path scripts/changelog-quality-check.py). This script is also present in the ttn-workflows repository.</p><p><em>Please note:</em> This article won’t break down the CHANGELOG file assessment-related code present in the reusable workflow nor its script as that is not the main focus here— however, this logic <em>is</em> elaborated extensively in <a href="https://github.com/org-mushroom-kingdom/ttn-workflows/blob/main/README.md">the </a><a href="https://github.com/org-mushroom-kingdom/ttn-workflows/blob/main/README.md">ttn-workflows </a><a href="https://github.com/org-mushroom-kingdom/ttn-workflows/blob/main/README.md">README</a>.</p><h3>Checking out ttn-workflows: Why and How</h3><p>If you’ve read my <a href="https://medium.com/devops-dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609">previous</a> <a href="https://medium.com/devops-dev/building-and-testing-a-custom-status-check-with-a-github-actions-workflow-a-guide-9f3626682587">articles</a> about reusable workflows, you will see that things get a little more complex here compared to previous scenarios where all the work could be performed within the reusable workflow file itself. This time, we’re referencing a script within the reusable workflow’s repository and we have explicitly point to it to perform the brunt of our logic.</p><h4>Why the Need to Checkout?</h4><p>When a caller workflow is triggered, it is <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations">run within the context of its own repository</a>. This poses an issue for us— trying to run or even grant permissions to the reusable workflow’s script will give us errors that the script doesn’t exist.</p><p>This may seem obvious because there is no scripts/changelog-quality-check.py path in ttn-frontend or ttn-backend, but it surprised me at first. I had assumed that the reusable workflow could access a script in its own repository with no problem — you might think that since it’s running, it would implicitly switch to the context of its own repo. As I found out, that’s not the case. Our caller workflow fired off first, so we’re running things from the context of its repository. Because of that, we have to checkout the ttn-workflows repo so we can access the script.</p><h4>How to Checkout Another Repository in a Workflow</h4><p>So <em>how</em> do we access this script? We checkout the reusable workflow’s repository, then point to it. It’s easier than you think — if you’ve used Github Actions at all, you’re familiar with the practically ubiquitous action <a href="https://github.com/actions/checkout">actions/checkout</a>.</p><p>It’s commonly the first thing you see in several workflows. In this scenario we use it twice: first in the caller repo, and now again in the reusable workflow, this time with arguments!</p><p>Take a look at the changelog-quality-checks.yml gist below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1435b2094acea6c778a60816f141e62a/href">https://medium.com/media/1435b2094acea6c778a60816f141e62a/href</a></iframe><p>The “<em>Checkout ttn-workflows repo (if non-manually triggered)</em>” step assesses if we’re running the workflow manually (if we were, the checkout would be skipped since we’d already be in the context of the ttn-workflows repo). Since the workflow was triggered via workflow_call, the step will use actions/checkout in conjunction with the following arguments:</p><ul><li>repository: The specific repository to checkout. (<em>Note</em>: In the actions/checkout used in the caller workflow, we don’t need to specify this because the default activity checks out the caller workflow’s repository. Since we need to check out ttn-workflows, we specify it here.)</li><li>path: The directory in the runner to put the repository contents (<em>Note</em>: this is relative to GITHUB_WORKSPACE. It should be present at top-level. In this example we checkout the ttn-workflows repository into the ttn-workflows-repo directory).</li><li>token: The token that has the relevant permissions (specifically, the repo permission) necessary to checkout the reusable workflow’s repository. (<em>Note</em>: This is a generated token — we can’t use the pre-established GITHUB_TOKEN in the caller repo and pass it to the reusable workflow because <a href="https://docs.github.com/en/actions/concepts/security/github_token#about-the-github_token">GITHUB_TOKEN’s permissions are scoped to a single repository</a>.)</li></ul><h3>Accessing the Contents of a Checked Out Repo</h3><p>After we’ve checked out the ttn-workflows repository into the ttn-workflows-repo path, we can then call the changelog-quality-check.py script simply by referencing its path like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/333adaeba1a6ca804075f339a87c0d04/href">https://medium.com/media/333adaeba1a6ca804075f339a87c0d04/href</a></iframe><p>The logic above also accounts changelog-quality-checks.yml being triggered manually or not. It isn’t in our case, so we set the REPO_PATH environmental variable to “ttn-workflows-repo”, the value of path used in the previous step. In other words, the full path used in the lower two steps would be ttn-workflows-repo/scripts/changelog-quality-check.py.</p><p>Based upon the results of the script, the changelog-quality-checks.yml workflow returns a status (not pictured) that can then be leveraged by the caller workflow, such as in a <a href="https://medium.com/devops-dev/building-and-testing-a-custom-status-check-with-a-github-actions-workflow-a-guide-9f3626682587">branch protection rule</a>. Standard post-checkout activity occurs, and that’s it. Not bad at all!</p><h3>Testing</h3><p>Testing to see if the caller-reusable workflow relationship works as expected is very easy. All we need to do is create a release branch, make a commit on it, and then open a pull request to main.</p><p>If I want to test for all the different outcomes related to the CHANGELOG file, I can do that all using the same pull request. The beauty of the pull_request trigger is that <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request">by default, it gets triggered off a pull request being opened, synchronized (a commit was made to the source branch after the pull request was opened), or reopened</a>.</p><p>The synchronize trigger is key here — I can just make another commit while the pull request is open and run a different test case. For example, let’s say in ttn-frontend I have a release/v1.2 branch, and my first commit is creating a CHANGELOG file named CHANGELOG-frontend-v1.2.txt (the happy path scenario). I open the pull request which will be the very first time the caller workflow is triggered.</p><p>I then go and look at the results. Things look great, but I still want to test scenarios like a bad CHANGELOG name. To do that, I can just rename my CHANGELOG file incorrectly in a new commit, and then push it. The pull request more or less detects that change (this is the synchronize activity). That triggers the caller workflow again; I can rinse and repeat from there.</p><p>As an aside, in previously displayed code snippets there is logic that allows one to test this reusable workflow via manually triggering it in its own repository in addition to calling it from a caller workflow. Basically, the reusable workflow assesses what repository called it and/or if it was manually executed. The evaluation of that determines whether the workflow will execute certain steps. It’s handy to have it set up like this in case you want to specifically test something related to the reusable workflow/script versus the caller-reusable workflow relationship, or if you want to iterate further on the reusable workflow.</p><h3>Conclusion</h3><p>This article has shown how to call upon a reusable workflow in a different repository and explained the how and why of checking out that workflow’s repository to execute desired behavior. Using the methodology explained here, you can see why it’s important to properly contain reusable workflows and their associated items (like scripts) in their own repository. Perhaps more importantly, you have been shown <em>how</em> to link it all together.</p><p>Are you as sick as I am of the word ‘reusable’ after getting to this point? Once you get over that malaise, try setting up something similar for yourself! The best way to learn, after all, is through (Github) action!</p><h3>Sources</h3><p>Links present in the article are listed here in order of appearance.</p><p>Please note the following:</p><ul><li>Some links may be present more than once in the article. To keep things brief, only the first instance is listed.</li><li>A # present in the title of the source indicates a bookmark on that page.</li></ul><ol><li>“Creating a composite action”, <em>Github (documentation)</em>: <a href="https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action">https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action</a></li><li>“Reuse workflows”, <em>Github (documentation)</em>: <a href="https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows">https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows</a></li><li>“org-mushroom-kingdom”, <em>Github organization</em>: <a href="https://github.com/org-mushroom-kingdom/">https://github.com/org-mushroom-kingdom/</a></li><li>“ttn-frontend”, <em>Github repository</em>: <a href="https://github.com/org-mushroom-kingdom/ttn-frontend">https://github.com/org-mushroom-kingdom/ttn-frontend</a></li><li>“ttn-backend”, <em>Github repository</em>: <a href="https://github.com/org-mushroom-kingdom/ttn-backend">https://github.com/org-mushroom-kingdom/ttn-backend</a></li><li>“ttn-workflows”, <em>Github repository</em>: <a href="https://github.com/org-mushroom-kingdom/ttn-workflows">https://github.com/org-mushroom-kingdom/ttn-workflows</a></li><li>“Github Actions: Creating, Calling, and Testing a Reusable Workflow”, <em>Medium</em>: <a href="https://blog.devops.dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609">https://blog.devops.dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609</a></li><li>“Building and Testing A Custom Status Check with a Github Actions Workflow: A Guide”, <em>Medium</em>: <a href="https://blog.devops.dev/building-and-testing-a-custom-status-check-with-a-github-actions-workflow-a-guide-9f3626682587">https://blog.devops.dev/building-and-testing-a-custom-status-check-with-a-github-actions-workflow-a-guide-9f3626682587</a></li><li>“actions/checkout”, <em>Github</em>: <a href="https://github.com/actions/checkout">https://github.com/actions/checkout</a></li><li>“GITHUB_TOKEN: #About the Github Token”, <em>Github documentation</em>: <a href="https://docs.github.com/en/actions/concepts/security/github_token#about-the-github_token">https://docs.github.com/en/actions/concepts/security/github_token#about-the-github_token</a></li><li>“Events that trigger workflows #pull_request”, <em>Github documentation</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request">https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=992adbe7b3ae" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/github-actions-checking-out-and-utilizing-a-reusable-workflows-repository-992adbe7b3ae">Github Actions: Checking Out And Utilizing a Reusable Workflow’s Repository</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building and Testing A Custom Status Check with a Github Actions Workflow: A Guide]]></title>
            <link>https://blog.devops.dev/building-and-testing-a-custom-status-check-with-a-github-actions-workflow-a-guide-9f3626682587?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f3626682587</guid>
            <category><![CDATA[github-repositories]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Sun, 21 Dec 2025 12:38:19 GMT</pubDate>
            <atom:updated>2025-12-21T12:38:19.631Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Reaching new heights in standardization</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*ch7VLH8zkEiz30teUMsU_g.png" /></figure><h3>Introduction</h3><p><a href="https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets">Github rulesets</a> are a great way to ensure that your pull requests (PRs) meet certain criteria before they are allowed to merge. However, while these rulesets provide several options, they are not all encompassing. Status checks serve as a way to enhance rulesets; requiring them can add strictness that’s not available by default.</p><p>One way a status check can be created is through a Github Action workflow; a Github Action is <a href="https://medium.com/@mc999/getting-started-with-github-actions-05ca591797a5">an automation process whose logic can be triggered in several ways</a>, with a workflow being the piece where the main business logic fires off. Workflows, through their jobs, can return passing or failing codes. These codes can be utilized to rule a status check as successful or not. In this article, we’ll go over how to build a workflow that returns a status code based on a branch naming convention, as well as how we incorporate the workflow as a status check to a ruleset.</p><h3>Article Notes</h3><p>You can follow along with the org-mushroom-kingdom/bash-git-script repository <a href="https://github.com/org-mushroom-kingdom/bash-git-script">here</a>, specifically looking at the .github/workflows directory and the sc-team-luigi-naming.yml within.</p><p>Note that you will jump around a bit in this article due to the way this particular workflow and ruleset were developed. The article makes this clear when this is the case. When referring to other sections in this article, <strong><em>Bold and italicized font</em></strong>, with a colon (:) indicating subsections is used (ex. If referring to the subsection regarding event triggers in the workflow, this would be written as <strong><em>Creating the Workflow: Adding Event Triggers</em></strong>)<strong><em>.</em></strong></p><p>Lastly, there are several links throughout the article. These are listed in the <strong><em>Sources</em></strong> section in a citation-like format, roughly in order of appearance.</p><h3>Scenario</h3><p>Imagine you are part of an organization named org-mushroom-kingdom and you are on the team team-luigi. team-luigi has an application they are working on: any release for this application is associated with a branch titled team-luigi/* (where * is a wildcard representing more characters, so release branches could be things like team-luigi/v1.0, team-luigi-v1.1.1, etc.).</p><p>team-luigi has a requirement regarding branches that get merged into a release branch. Specifically, such branches need to follow the naming convention feature/team-luigi/* for standardization purposes. If the branch does not follow this naming convention, it should not be allowed to merge into the release branch.</p><p>A branch ruleset doesn’t have an option for this particular scenario. However, we can encapsulate this logic into a status check, whose logic is stored in a Github Action workflow. In our ruleset, we can require that status check to pass to allow merging.</p><h3>Creating the Workflow</h3><p>We create the workflow first for two reasons:</p><ol><li>The workflow is going to contain the logic that performs the naming convention check, so working on the ruleset to enforce the check doesn’t make sense since the check isn’t completed yet.</li><li>When a ruleset is specified to require passing status checks, it needs at least one of those status checks explicitly listed. Assuming you don’t have any other status checks, you won’t be able to save the ruleset with “required status checks” enabled if you haven’t yet made the check referenceable.</li></ol><p>Let’s first start by creating a workflow file in the .github/workflows directory. We will name it sc-team-luigi-naming.yml.</p><h4>Adding Event Triggers</h4><p>We should define this workflow to fire off when a pull request is opened and the target branch for that pull request is a branch that begins with team-luigi/*. Thus, the on syntax should look like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/acd2bd85e540c03d8886ddc5789a345c/href">https://medium.com/media/acd2bd85e540c03d8886ddc5789a345c/href</a></iframe><p><a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request">Note that by default for the </a><a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request">pull_request event, a workflow only runs when the type of activity is opened, synchronize, or reopened.</a> To further specify for ONLY opened pull requests, you could use types: opened. However, we will not exercise this option for reasons explained later.</p><p>We also want to be able to test this workflow without having to manually open a pull request each time. For the moment, we’ll just add workflow_dispatch to indicate this action can be run manually. We’ll come back to workflow_dispatch later and flesh it out a bit to assist in manual testing (see <strong><em>Testing: Manual Tests</em></strong>).</p><h4>Adding Environmental Variables</h4><p>Next, we’ll establish several environmental variables.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed1e84fa119818c86d0653a20b986239/href">https://medium.com/media/ed1e84fa119818c86d0653a20b986239/href</a></iframe><p><em>Note</em>: In the workflow file, I have these defined at the top-level (workflow-level), but it’s probably more appropriate to put them at job-level. However, this workflow only has one job, so it’s not really an issue in this case.</p><p>For testing purposes (elaborated in the <strong><em>Testing</em></strong> section), we use the <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context">github context</a> to get things like the PR number, source branch name, and target branch name. GH_TOKEN is <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli">needed for a Github API call made via Github CLI</a>. GREEN, RED, and DONE are for message highlighting in print statements in the workflow.</p><h4>Constructing the Job</h4><p>Let’s build the job next:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4462fd42dec30723653e1be19bbed374/href">https://medium.com/media/4462fd42dec30723653e1be19bbed374/href</a></iframe><p>The name key is essential here — it’s needed to properly reference the job in our ruleset. runs-on indicates we’re using a Github-hosted runner, ubuntu-latest, a Linux virtual machine. We also need to give permissions to the GITHUB_TOKEN to write to pull requests. This is so we can inform the user via a pull request comment their branch naming convention is incorrect.</p><p>Next, let’s get to the steps that will perform the naming convention check and a follow-up logic in the event the source branch doesn’t follow this convention. Observe the following Github gist:</p><p><em>Note: If you’re following along with the workflow file </em>sc-team-luigi-naming.yml<em> you’ll notice I am skipping two steps; one just performs print statements, and the other is for manually testing this action (it will be covered in the </em><strong><em>Testing </em></strong><em>section).</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f784d9f3b5549b4584be4edc0a2f103/href">https://medium.com/media/2f784d9f3b5549b4584be4edc0a2f103/href</a></iframe><p>In the first step in the above gist, we use a simple Bash string comparison to assess if the source branch begins with the specified naming convention:</p><ul><li>If it does, we exit with a passing status code (0). This status code gets passed to the PR, and since it’s successful, the source branch is allowed to be merged.</li><li>If it does not, we exit with a failing status code (1).</li></ul><p>The PR will receive this status code and allow or prevent the branch from being merged when incorporated with the ruleset.</p><p>As a user-friendly endeavor, we will save the pull request audience a click by automatically commenting on the PR why the status check failed. We set up the next step with an if: failure() clause so the step will only be performed if a previous step failed. Then, we use the Github CLI gh pr comment command, which in turn makes a call to the Github API to perform this action. (This is why we include GH_TOKEN in our environment variables and specify the permissions in our job.)</p><p>At this point, we are at a state where the logic in this workflow can be incorporated as a status check in the ruleset. However, let’s not jump the gun — it’s time to perform some simple preliminary testing.</p><h3>Testing</h3><p>Technically, you could skip to incorporating the workflow/job logic into a ruleset and test it by opening pull requests with varying source branch names. But rushing to do so is foolish, because when you inevitably run into an issue there’s some overhead depending on what that issue is — will you have to disable the ruleset temporarily, check your spelling of your source branch, or something else? It makes more sense to perform some simpler tests first to save yourself time in the long run.</p><p>The brunt of our tests during development can be performed manually via the Github Actions UI. We will have to create some pull requests towards the end of manual testing, but for this particular scenario we need only create two. The sections below detail the overall testing process.</p><h4>Manual Tests</h4><p>The <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow#configuring-a-workflow-to-run-manually">workflow_dispatch event allows us to test the workflow via the Github Actions UI</a>. We’ll create a choice input here, whose options are a source branch whose name matches the naming convention, and another that doesn’t. Note the presence of pull request numbers in parentheses.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25a9eef74c773feb68b47a2b52ebb8bd/href">https://medium.com/media/25a9eef74c773feb68b47a2b52ebb8bd/href</a></iframe><p>We’ll also make these branches in the repo itself. In each branch, we’ll make a dummy commit so some sort of difference shows up. Then, we’ll actually make pull requests to the team-luigi/v1.0 branch in the repo, and close them. This is important — the numbers of those pull requests are part of the string values in the choice input. It’s more important for the negative test case; when you begin to manually test this a bunch, all of the commenting activity will stay on that single PR. <em>And</em> since this particular workflow can be triggered by reopened pull requests, you can just reopen these PRs to test the workflow more organically later on.</p><p>We still need to actually evaluate the value of the input, however. This is why we set up the PR_NUMBER, SOURCE_BRANCH, and TARGET_BRANCH as environmental variables. We’ll create a step before the evaluation step to set those variables to specific values, <em>only</em> if we’re running the workflow manually:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb684b663697f0edef77f9281434c253/href">https://medium.com/media/eb684b663697f0edef77f9281434c253/href</a></iframe><p>Having the step set up like this makes it so the logic is unchanged in the steps that perform core logic. All we’ve done is reassigned the value of the environmental variables those steps reference.</p><h4>Running Preliminary Tests</h4><p>The Github Actions UI makes it very easy to <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow#running-a-workflow">run our tests manually</a>. All we need to do is navigate to the Actions page, find our workflow, hit the <em>Run workflow</em> button, and choose which of our inputs to use. All we’re looking for at the moment is to see if our workflow is passing/failing as expected.</p><h4>Preliminary Happy Path Testing</h4><p>If we run our first test with the first option (the source branch matches the naming convention), we should see our run is successful as indicated by the green check icon (this is a graphical representation of exit code 0).</p><p>Clicking on the run opens a page where we can see more details. Note the green text that indicates the run was successful.</p><figure><img alt="On the left: a screenshot showing the location of the preliminary happy path workflow run highlighted by a red circle. On the right: The page for the individual run." src="https://cdn-images-1.medium.com/max/1024/1*VI2gu3THHWOPgQni8IWCXw.png" /><figcaption>On the left: The location of the preliminary happy path workflow run highlighted by a red circle. On the right: The page for the individual run.</figcaption></figure><h4>Preliminary Negative Testing</h4><p>Next, we’ll do a run with the second option (the source branch does NOT match the naming convention, AKA our negative test case). This time, we should see the run failed, as indicated by the red “X” icon (this is a graphical representation of exit code 1).</p><p>Once again, click on the run to see more details. Note the red text that indicates the run failed, as well as the subsequent step that makes the API call to comment on the PR.</p><figure><img alt="On the left: a screenshot showing the location of the preliminary negative testing workflow run highlighted by a red circle. On the right: The page for the individual run." src="https://cdn-images-1.medium.com/max/1024/1*UbTT98BOC_oqgo8sC9wqKw.png" /><figcaption>On the left: The location of the preliminary happy path workflow run highlighted by a red circle. On the right: The page for the individual run.</figcaption></figure><p>If we navigate over to the corresponding pull request (<a href="https://github.com/org-mushroom-kingdom/bash-git-script/pull/90">#90</a> in this case), we should see a comment from the github-actions bot explaining why the pull request cannot be merged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lRBXYe5Si_2WYuRiiUvCVg.png" /></figure><p>Now that confidence in our manual tests has been assured, we should incorporate the workflow into a ruleset. After that, we can start testing with actual pull requests. (Go to the <strong><em>Incorporation Into the Ruleset</em></strong> section below, then come back up to the <strong><em>More Organic Tests — Pull Requests</em></strong> section)</p><h4>More Organic Tests - Pull Requests</h4><p>After the workflow has been incorporated into the ruleset (see <strong><em>Incorporation Into the Ruleset</em></strong> below), we need to test the workflow with actual pull requests.</p><p>Since we already made (and closed) pull requests to a team-luigi target branch, testing how this workflow will fire when a pull request is opened (or reopened, in our case) is almost effortless. Simply reopen the pull requests: A dynamic window towards the bottom of the pull request should appear showing the status check as pending, followed by a result the the check passed or failed (see screenshot below for an example of each result).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c4T8IVjR8AwY81mzpr5N1A.png" /><figcaption>— — Top half: Shows that the required status check has passed and pull request is allowed to merge. — —Bottom half: Shows that the required status check did NOT pass and pull request is NOT allowed to merge.</figcaption></figure><p>You are free to make more pull requests as you see fit, but as long as you don’t merge the ones you already made, you should be able to keep testing them via closing and reopening.</p><p>After this testing is complete, we have determined that our workflow and its functionality in our ruleset is working properly. Take the last jump to the <strong><em>Conclusion</em></strong> section!</p><h3>Incorporation Into the Ruleset</h3><p>After initial manual testing has been performed and proven the workflow functions as expected, we can incorporate it into a ruleset. <em>Note: </em><a href="https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets"><em>Per documentation</em></a>,<em> you will need admin permissions or to be assigned a custom role with the “edit repository rules” permission to do this. Also, this process assumes you are incorporating the workflow into a branch ruleset as opposed to a classic branch protection rule. The two are similar, but not the same.</em></p><p>We’ll create a ruleset named team-luigi-rules. In the ruleset settings, under <em>Target Branches</em>, we will input team-luigi/* to indicate we want this ruleset to apply to any branch that begins with team-luigi/. This accounts for when the team has a branch for a newer release (ex team-luigi/v1.1.1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3K-RY076EQF33yzFFNWtxA.png" /><figcaption>The team-luigi/* pattern added to the <strong><em>Target Branches</em></strong> section.</figcaption></figure><p>Next we’ll check the checkbox <em>Require a pull request before merging</em> so that users can’t just push to this branch whenever they want. Having a pull request be required also makes pushes to the release branch more standardized, and more obvious when a status check fails (see <strong><em>Testing: More Organic Tests — Pull Requests</em></strong> for details). We don’t need to change anything else here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Klzeh-BGz2gV9DD79q7L5A.png" /><figcaption>Checking the checkbox to require pull requests.</figcaption></figure><p>We then check the <em>Require status checks to pass</em> checkbox. Click the <em>Show additional settings</em> dropdown to reveal the <em>Status checks that are required</em> area. Hit the <em>Add checks</em> button. This reveals a text box; go to the workflow file and copy the value of the <em>job</em>-level name key (Check source branch naming convention) and paste it in the text box (you can also try to search for the job via a word it includes). This should result in a hit, with a selectable checkbox appearing next to the value. Checking the box and clicking anywhere else after adds our workflow job as a status check.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mqg3U80uzvuHaOjdLne5xQ.png" /><figcaption>Searching for a substring within the job-level <strong>name</strong> key so we can find the job. Once added, it will be configured as a status check.</figcaption></figure><p>Lastly, double check the rule is enabled by scrolling to the top of the page and confirming <em>Enforcement status</em> is set to <em>Active</em>. Then, scroll to the bottom of the page and hit <em>Save changes</em>. Now, you can begin to test your workflow with actual pull requests — jump to the <strong><em>Testing: More Organic Tests — Pull Requests</em></strong> section.</p><h3>Conclusion</h3><p>By the end of this article, you should be able to grasp how to configure a simple workflow job into a status check for a Github ruleset and test it rigourously. This logic can be greatly expanded upon to fit your particular repository’s needs, adding further scrutiny to what’s getting pushed. The versatility of Github Actions allows you to trigger these workflows/status checks on virtually any repository related event, automating processes that might be tedious or prone to error otherwise. The world is literally at your fingertips — try working with these processes in your repo today!</p><h3>Sources</h3><p>1. “About rulesets”, <em>Github</em>: <a href="https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets">https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets</a></p><p>2. “Getting Started With Github Actions”, <em>Medium</em>: <a href="https://medium.com/@mc999/getting-started-with-github-actions-05ca591797a5">https://medium.com/@mc999/getting-started-with-github-actions-05ca591797a5</a></p><p>3. “org-mushroom-kingdom/bash-git-script”, <em>Github repository</em>: <a href="https://github.com/org-mushroom-kingdom/bash-git-script/tree/main/.github/workflows">https://github.com/org-mushroom-kingdom/bash-git-script/tree/main/.github/workflows</a></p><p>4. “Events that trigger workflows”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request">https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request</a></p><p>5. “Contexts reference”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context">https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context</a></p><p>6. “Using GitHub CLI in workflows”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli">https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli</a></p><p>7. “Manually running a workflow”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow">https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow</a></p><p>8. “Feature/wrong lui formatted #90” <em>Github repository pull request</em>:<a href="https://github.com/org-mushroom-kingdom/bash-git-script/pull/90">https://github.com/org-mushroom-kingdom/bash-git-script/pull/90</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*MUuKhUCoWRK4nRPNGgFZjw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f3626682587" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/building-and-testing-a-custom-status-check-with-a-github-actions-workflow-a-guide-9f3626682587">Building and Testing A Custom Status Check with a Github Actions Workflow: A Guide</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Github Actions: Creating, Calling, and Testing a Reusable Workflow]]></title>
            <link>https://blog.devops.dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/08684d697609</guid>
            <category><![CDATA[repositories]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github-workflow]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Thu, 18 Dec 2025 05:52:38 GMT</pubDate>
            <atom:updated>2025-12-19T11:40:31.397Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A simple guide to extend usability</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hiHDl4UgyW2gA4Ow" /><figcaption>Photo by <a href="https://unsplash.com/@quinoal?utm_source=medium&amp;utm_medium=referral">Quino Al</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p><a href="https://medium.com/@mc999/getting-started-with-github-actions-05ca591797a5">Github Actions</a> are a great way to automate various activities within your repository. While they’re quite flexible in how they can be triggered, this flexibility extends to their reusability as well. Similar to actions, <a href="https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows">workflows can be set up to be reusable</a>.</p><p>In this article, we’ll first explore how to set up a reusable workflow in one repo. Then, in another repo, we will review how to set up the <em>caller workflow</em>, i.e. the workflow that calls upon the reusable workflow.</p><p>You can follow along with these links:</p><ul><li><a href="https://github.com/mcummings128/reusable-workflow-github-actions/blob/main/.github/workflows/reusable-workflow-2-teams.yml">Reusable workflow</a>: Located in the mcummings128/reusable-workflow-github-actions repository.</li><li><a href="https://github.com/org-mushroom-kingdom/bash-git-script/blob/main/.github/workflows/ex-caller-workflow-2.yml">Caller workflow</a>: Located in the org-mushroom-kingdom/bash-git-script repository.</li></ul><p>Additionally, be sure to check out the links in this article. The <strong><em>Sources</em></strong> section at the end contains an index of all the links used.</p><h3>Scenario</h3><p>This article explores the scenario of a organization-owned repository org-mushroom-kingdom/bash-git-script calling upon a reusable workflow located in a trusted public repository mcummings128/reusable-workflow-github-actions. The reusable workflow accepts an argument of an organization team name, as well as a token with the proper permissions to access the team. The workflow then outputs the members of that team line by line. It’s a simple scenario — one that could be set up by the members of bash-git-script, but they’re lazy in this case.</p><p>The bash-git-script developers’ approach is to have their own <em>caller workflow</em>, which is a workflow that calls upon a reusable workflow. This is a standard practice (as an aside, when you have the caller workflow and reusable workflow in the same organization it can help alleviate some of the overhead that comes with reusable workflows, like token management. In this article, we choose to take the more difficult path and work with a non-organization repo).</p><h3>Creating the Reusable Workflow</h3><p>Let’s switch to the perspective of the developers of the reusable-workflow-github-actions repository, who as the name says developed the reusable workflow reusable-workflow-2-teams.yml.</p><h4>The workflow_call event</h4><p>In order to for a workflow to be called upon, it must have the workflow_call event defined in the on section.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d1c11244127bff4ad01837bef13b8ae1/href">https://medium.com/media/d1c11244127bff4ad01837bef13b8ae1/href</a></iframe><p>This event has child keys that can receive input from the caller workflow, further elaborated on in the following subsection.</p><h4>Capturing the Caller Workflow’s Inputs and Secrets</h4><p>The reusable workflow is set up in a way that it can receive two “arguments”, much like a function. One argument is is a token that grants permission to perform activity related to accessing the team and the other is the name of the team whose members will be read.</p><p><strong>Using the secrets key</strong></p><p>The action of this particular reusable workflow requires the use of a token that has the org:read permission in order to look at the organization’s team members. Unfortunately, we cannot grant the built-in GITHUB_TOKEN this permission because GITHUB_TOKEN’s <a href="https://docs.github.com/en/actions/concepts/security/github_token">permissions are limited at a repository-level, not organization-level</a>.</p><p>However, it’s not that difficult to make a personal access token and give it org:read permissions. We’ll have to do this in the caller workflow’s repository (bash-git-script), and pass it to the reusable workflow (creating a token with permissions is not discussed in this article). The token is able to be received via the secrets key. It can then be referenced with the <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#secrets-context">secrets context</a> (see the <strong><em>Core Logic</em></strong> section for details).</p><p><strong>Using the inputs key</strong></p><p>To define non-secret inputs the reusable workflow will receive, we use the inputs key. We can then reference whatever input using the inputs context.</p><p>This reusable workflow requires that the team name be passed to it. Refer to the above gist — you can see this input is pretty straightforward; its name is team_name, of type string, with a default value of “no team specified”. In other words, the caller workflow will pass in a string containing the team name to this reusable workflow, which captures that input for later use (see the <strong><em>Core Logic</em></strong> section for details).</p><h4>Environmental Variables</h4><p>Since the reusable workflow is simple (you’ll see in a bit it’s only one step), we only need to set one environmental variable. At workflow-level, we write:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b4a327075380d525323e24870c78c24/href">https://medium.com/media/5b4a327075380d525323e24870c78c24/href</a></iframe><p><em>Note</em>: In a more robust workflow, it would be more appropriate to have the env key at job-level or step-level. Since this workflow is so simple, it doesn’t really matter.</p><p>The GH_TOKEN is needed because one of our steps calls upon the Github CLI. In Github Actions, <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli">when Github CLI is used an environmental variable named GH_TOKEN must be utilized</a>. All we need to do is pass our token via the secrets key and we’re good to go!</p><h4>Core Logic</h4><p>The job of this reusable workflow is composed of one step as seen below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b98c6321237f67602fa370afff8e1972/href">https://medium.com/media/b98c6321237f67602fa370afff8e1972/href</a></iframe><p><em>Note: If you are following along with the reusable workflow file, you will notice that there is a commented out cURL command. This is vestigial code but I left it in as it’s a good example of how to use cURL vs. the Github CLI to call the Github API.</em></p><p>Similar to how we referenced our token, we use the inputs context to access inputs from the caller workflow. Based on that input, we do <em>one</em> of the following:</p><ul><li>We account for the rare event a team name wasn’t passed, and output a message that this was the case. In this case nothing else happens.</li><li>We use the Github CLI to call the Github API, specifically the “<a href="https://docs.github.com/en/rest/teams/members?apiVersion=2022-11-28#list-team-members">List team members</a>” endpoint. Then we iterate through the members and output them. This logic is explained more in the following paragraphs.</li></ul><p>The <a href="https://cli.github.com/manual/gh_api">Github CLI command </a><a href="https://cli.github.com/manual/gh_api">gh api</a> is used to call an endpoint of the Github API. In the official documentation for almost any Github API endpoint, an example of how to make a call to it using the Github CLI is provided; this is where the headers (-H) come from. The first two headers are straight up copy-pasted from <a href="https://docs.github.com/en/rest/teams/members?apiVersion=2022-11-28#list-team-members">the documentation</a>, while the third is slightly modified to use our GH_TOKEN. The endpoint URL is modified to use inputs.team_name as the <a href="https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#get-a-team-by-name">team slug</a>.</p><p>We use some Bash here to make the API’s JSON response workable:</p><ol><li>We use Bash and <a href="https://jqlang.org/">jq</a> to output just the login names of the users (via piping)</li><li>Capture the whole piped command with &lt;(), meaning that we are using <a href="https://tldp.org/LDP/abs/html/process-sub.html">process substitution</a> to treat that output as if it were a file.</li><li>Use <a href="https://ss64.com/bash/mapfile.html">mapfile</a> to take the output (which is acting as a file) and populate an array called team_members with the logins. (The -t flag is used to get rid of trailing whitespace)</li></ol><p>Now that we have an array of strings, we use standard Bash for loop syntax to output each login. Beautiful! We’re ready to move on to actually calling this workflow.</p><h3>Creating the Caller Workflow</h3><p>Now that you know how the reusable workflow functions, all that’s left to do is call it. In the org-mushroom-kingdom/bash-git-script repo, we’ll make a new caller workflow whose path will be .github\workflows\ex-caller-workflow-2.yml.</p><p>We’ll set the caller workflow to only be manually triggered for now as <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow">indicated by the </a><a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow">workflow_dispatch key</a>. We’ll also set up a corresponding choice input with each option corresponding to a team name within the org-mushroom-kingdom organization.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5195e6b0fc711449ef83f8be1e0ac212/href">https://medium.com/media/5195e6b0fc711449ef83f8be1e0ac212/href</a></iframe><p>Next, we’ll set up our job to call the reusable workflow:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bae841498de277c46b6af4692c0e3cb8/href">https://medium.com/media/bae841498de277c46b6af4692c0e3cb8/href</a></iframe><p>The uses key defines the location of our reusable workflow reusable-workflow-2-teams.yml with a specific commit SHA (found by looking at the commit history in the reusable-workflow-github-actions repository). The SHA is used as a <a href="https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows#calling-a-reusable-workflow">best practice</a> — it’s a known moment in time that reusable workflow is confirmed working.</p><p>The secrets key is where we provide org-mushroom-kingdom/bash-git-script’s token that has org:read access (the token’s name is TEAMS_READ_ACCESS). The reusable workflow will be able to utilize this since it has a corresponding secrets key set up. Note how the child of the secrets key (teams_read_token) in the caller workflow uses the same name as what was set up in the reusable workflow.</p><p>The with key is where we provide other, non-secret arguments to be used by the reusable workflow. Just like with how secrets was set up, note how the child of the with key (team_name) in the caller workflow uses the same name as what was set up in the reusable workflow inputs section.</p><p>That’s it as far as the caller workflow goes. Let’s move right along to testing everything out.</p><h3>Testing</h3><p>At this point, we know how the reusable workflow works and we’ve set up our caller workflow to call it. All that remains is testing it — since we have the workflow_dispatch event in our caller workflow, we can leverage the Github Actions UI to easily run our test.</p><p>Specifically, we:</p><ol><li>In org-mushroom-kingdom/bash-git-script, navigate to the <em>Actions</em> section.</li><li>We locate our caller workflow (identified by the name “<em>Example Caller Workflow 2 (Get users from a team)”</em> )in the left sidebar, and click it.</li><li>Click the <em>Run workflow</em> dropdown, then select the value for our input (i.e. one of the team names).</li><li>Click the green <em>Run workflow</em> button.</li></ol><p>See the below screenshot for more context on the above instructions.</p><figure><img alt="Shows a visual depicting how to run the caller workflow manually. The top “Run workflow” dropdown is opened. Inside it, the value for the team name input is “team-peach”. Another “Run workflow” is also in this dropdown — this one is green, and clicking it will run the caller workflow." src="https://cdn-images-1.medium.com/max/1024/1*aVG2Fr0G5DREkljIMWxLsw.png" /></figure><h4>Assessing Results</h4><p>After our workflow has run, we should see a green checkmark indicating the run was successful. Clicking on that run leads us to its individual page. From there, clicking the step <em>Print the message</em> expands the output for that step, where we see each team member listed on a new line.</p><figure><img alt="The results of running the caller workflow. The team members of “team-peach” are shown, each on an individual line (ex. “- mcummings128”)" src="https://cdn-images-1.medium.com/max/1024/1*7uV2GGtQetOKhBWAn64UnA.png" /></figure><p>Now everything has come full circle. We’ve successfully called upon another repository’s workflow and leveraged it for our own use! The devs of bash-git-script can now be confident in utilizing this reusable workflow.</p><h3>Conclusion</h3><p>This article has shown you how to construct a simple reusable workflow (maybe you learned a little Bash along the way), how to create a caller workflow, and tying the two together with a simple manual test.</p><p>While all the reusable workflow is doing is listing team members at the moment, perhaps in the future, the devs of reusable-workflow-github-actions will elaborate on it. For example, they could see which member of each team has the top commits in some sort of morale-boosting exercise. That logic would be more advanced, but the skeleton of it is very much the same as laid out here.</p><p>Instead of reinventing the wheel, reusable workflows let you borrow it, keeping repositories uncluttered and straightforward. And really, isn’t that half the battle?</p><h3>Sources</h3><p>This section lists all the links found in various sections throughout this article, generally in order of appearance. Note that some links may point to the same webpage, but a different bookmark. If this is the case, the bookmark will be listed in parentheses.</p><p>The format of these links is as follows:</p><ul><li>Title of the webpage, in quotes</li><li>Name of the domain/organization (or description, if appropriate), in italics</li><li>The URL to the webpage</li></ul><ol><li>“Getting Started With Github Actions”, <em>Medium</em>: <a href="https://medium.com/@mc999/getting-started-with-github-actions-05ca591797a5">https://medium.com/@mc999/getting-started-with-github-actions-05ca591797a5</a></li><li>“Reuse workflows”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows">https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows</a></li><li>“reusable-workflow-2-teams.yml”, <em>Github repository (selected file)</em>: <a href="https://github.com/mcummings128/reusable-workflow-github-actions/blob/main/.github/workflows/reusable-workflow-2-teams.yml">https://github.com/mcummings128/reusable-workflow-github-actions/blob/main/.github/workflows/reusable-workflow-2-teams.yml</a></li><li>“ex-caller-workflow-2.yml”, <em>Github repository (selected file)</em>:<em> </em><a href="https://github.com/org-mushroom-kingdom/bash-git-script/blob/main/.github/workflows/ex-caller-workflow-2.yml">https://github.com/org-mushroom-kingdom/bash-git-script/blob/main/.github/workflows/ex-caller-workflow-2.yml</a></li><li>“GITHUB_TOKEN”, <em>Github</em>: <a href="https://docs.github.com/en/actions/concepts/security/github_token">https://docs.github.com/en/actions/concepts/security/github_token</a></li><li>“Contexts reference”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#secrets-context">https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#secrets-context</a></li><li>“Using GitHub CLI in workflows”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli">https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli</a></li><li>“REST API endpoints for team members”, <em>Github</em>: <a href="https://docs.github.com/en/rest/teams/members?apiVersion=2022-11-28#list-team-members">https://docs.github.com/en/rest/teams/members?apiVersion=2022-11-28#list-team-members</a></li><li>“gh api”, <em>Github CLI</em>: <a href="https://cli.github.com/manual/gh_api">https://cli.github.com/manual/gh_api</a></li><li>“jq”, <em>./jq</em>: <a href="https://jqlang.org/">https://jqlang.org/</a></li><li>“Chapter 23. Process Substitution”, TLDP — <em>The Linux Documentation Project</em>:<a href="https://tldp.org/LDP/abs/html/process-sub.html">https://tldp.org/LDP/abs/html/process-sub.html</a></li><li>“mapfile”, <em>ss64</em>: <a href="https://ss64.com/bash/mapfile.html">https://ss64.com/bash/mapfile.html</a></li><li>“Manually running a workflow”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow">https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow</a></li><li>“Reuse workflows (see ‘Calling a Reusable workflow’)”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows#calling-a-reusable-workflow">https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows#calling-a-reusable-workflow</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*MUuKhUCoWRK4nRPNGgFZjw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08684d697609" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/github-actions-creating-calling-and-testing-a-reusable-workflow-08684d697609">Github Actions: Creating, Calling, and Testing a Reusable Workflow</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started With Github Actions]]></title>
            <link>https://blog.devops.dev/getting-started-with-github-actions-05ca591797a5?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/05ca591797a5</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 05:06:19 GMT</pubDate>
            <atom:updated>2025-12-31T10:14:14.999Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Automating and streamlining CI/CD activity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*sACOHyDbvHR0nfYMGoDkrg.png" /></figure><h3>Introduction</h3><p>Github Actions are a programmatic way of automating various processes regarding CI/CD activity. Ranging from simple to complex, they can make software deployments and source control processes simpler, safer, and swifter. It is relatively easy to pick up the basics of them and incorporate them into repositories, as you will soon discover.</p><p>This article goes over the main components of Github Actions and how they work together. Each component is compartmentalized into its own section, covering the basics about that component. Links with more detailed information are present in each section —be sure to check them out. The <strong><em>Sources</em></strong> section at the end of this article lists all of the links used throughout this article in a citation-like format.</p><p>Note that when referring to sections in this article, the referenced section will be emphasized in <strong><em>bold and italics</em></strong>. The Medium-style code syntax is also used to highlight various code-related aspects, mainly workflow keys and events.</p><h3>How Do Actions Work?</h3><p>There are several key components to make a Github Action function. A basic summary of how these components work together can be defined as:</p><p>An <em>event</em> triggers an action’s <em>workflow</em> to run. Workflows contain the business logic of the action. They are broken down into one or more <em>jobs</em>, which are further broken down into <em>steps</em>. Workflows are run via a <em>runner</em>, a server/virtual machine capable of running workflows.</p><p>These components work together to automate various repository-related logic in a dynamic matter. In addition to the sections below, be sure to refer to the <a href="https://docs.github.com/en/actions/get-started/understand-github-actions">official documentation </a>for additional explanations about these components at a basic level.</p><h3>Events</h3><p>An <em>event</em> can be defined as something that triggers an action to fire off. This is usually a <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows">repository-related event</a>, such as a pull request or some sort of branch activity. Actions can also be <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow">triggered manually</a>, triggered externally, or <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onschedule">scheduled</a>. Additionally, the same action can be triggered by <a href="https://docs.github.com/en/enterprise-cloud@latest/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#using-multiple-events">multiple events</a>.</p><p>Events are vast and customizable depending on your needs. You can further specify some events via <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#about-events-that-trigger-workflows">activity types</a>; for example, you may want an action to trigger only when a pull request is opened.</p><p>In a workflow, the on key is used for event specification — See the <strong><em>Common Workflow Keys: on</em></strong> section for more information.</p><h4>Repository-related Events</h4><p>As mentioned previously, the most common way to trigger an action is via a <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows">repository-related event</a> such as a push, new branch creation, etc. In fact, there are so many of these events it would be cumbersome to list them all in this article! Refer to the link in this paragraph for a full breakdown.</p><h4>External-Trigger Events</h4><p>There may be some cases where the provided repository-related events do not encapsulate the particular activity you are trying to trigger off of. For example, there is no event defined for the repository being cloned.</p><p>You can use the repository_dispatch event to define custom events. <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#repository_dispatch">This particular event</a> is a way something external to Github can trigger an action. Adding on to our previous example, say you have a script that clones your repo. You could send a request to the <a href="https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event">Github API repository_dispatch endpoint</a> after this clone takes place, essentially triggering the workflow when your repo has been cloned.</p><p>The workflow_dispatch event is also an endpoint of the Github API, serving as an alternate way to externally trigger an action. Triggering an action via workflow_dispatch can be simpler than doing so with repository_dispatch, but is also somewhat more restrictive.</p><h4>Manual-Trigger Events</h4><p>Events can also be <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow">triggered manually</a>, via a special event known as workflow_dispatch. Triggering an action via <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_dispatch">this event</a> also allows you to run an action with certain inputs. See <strong><em>Common Workflow Keys: workflow_dispatch</em></strong> for more information.</p><p>Note: The workflow_dispatch event is also an endpoint of the Github API, providing a way to trigger an action externally. See the above section for details.</p><h4>Schedules as Events</h4><p>Actions can also be <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule">scheduled to run</a> rather than triggered dynamically. This is useful for automating things like report generation. A schedule can be seen as an event since it triggers an action.</p><p>An action can have one or more schedules. See <strong><em>Common Workflow Keys: schedule and cron </em></strong>for more information regarding how to set up schedules.</p><h3>Workflows</h3><p>A <a href="https://docs.github.com/en/actions/get-started/understand-github-actions#workflows">workflow</a> is a YAML file (.yaml, .yml extension) that contains the business logic for the action and defines how it works. (If you haven’t used YAML, the most basic explanation of it structure is that it is based on keys and values, with important attention to whitespace. A basic overview of YAML can be found <a href="https://spacelift.io/blog/yaml#what-is-yaml">here</a>.)</p><p>The <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax">official documentation</a> lists all workflow keys, their uses, examples, and minutiae related to each. Note that some keys can be used at multiple levels within a workflow (said levels being workflow/top-level, job-level, and step-level).</p><p>Workflow files are required to be stored in the .github/workflows directory.</p><h4>Common Workflow Keys</h4><p>Workflows are composed of several keys — below is a selection of common keys you may encounter:</p><p><strong>name</strong>: The name key is used to define the name of something related to the workflow. It is present in different levels of a workflow file:</p><ul><li>If workflow-level (top-level), it defines the name of the workflow as it will appear in the Github Actions UI.</li><li>If job-level, it defines the name of the job as it will appear in the Github Actions UI under that specific workflow.</li><li>If step-level, it defines the name of the step as it will appear in the Github Actions UI.</li></ul><p>See the <strong><em>Github Actions UI </em></strong>section for details on how the UI works and how this key relates to it.</p><p><strong>env:</strong> The env key can also be used in different levels of a workflow file. It is used to define environmental variables, the scope of which is determined by what level it’s on. At workflow-level, all jobs and steps within those jobs have access to said variables. At job-level, all steps within the corresponding job have access, while at step-level only that particular step will have access.</p><p><strong>on</strong>: Actions define their triggering event through the on key. Some events can be further broken down via utilizing the types key (See the <strong><em>Common Workflow Keys: types</em></strong> section below for more information).</p><p>on can support multiple triggers (in other words, you can have the same action fire based on different events; for example, you could fire the same action when a feature branch is created and when that branch is pushed to the repo if you wanted to do something like get average time estimate of how long branches are “alive” before they get merged into the repo).</p><p><strong>types:</strong> The types key is a direct child of the on key. It defines the <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#using-activity-types">activity types</a> of that event. This is useful for further specifying how the action should be triggered.</p><p><strong>schedule and cron:</strong> The schedule key is a direct child of the on key. It is used when you want the action to fire on specific dates and times. For example, say you wanted to ensure new files added to the repo were accounted for in CODEOWNERS by the end of the month. You could schedule such logic to fire off at the end of the month, and generate a report of sorts to let you know of any outstanding items.</p><p>Schedules are defined by child cron keys. Thus the name for this section “schedule and cron” — you can’t have one without the other. You can use one or multiple cron keys (see next paragraph for details on multiple keys). Each cron key is defined by <a href="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07">POSIX cron syntax</a> (if you don’t know what this is, it’s an alphanumeric syntax that defines time periods. See the link in this paragraph and the one in the next paragraph for more information).</p><p>A single workflow can have multiple schedules that trigger it (i.e. multiple cron keys). The <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule">official documentation</a> gives examples of how you can configure one workflow to function dynamically on different schedules using conditional logic.</p><p><strong>workflow_dispatch</strong>: The workflow_dispatch key is a child of the on key. It’s used to indicate the action can be executed manually via the Github Actions UI page (this is very useful for testing). It will often have a child key inputs to customize how the workflow is run. See the <strong><em>Common Workflow Keys: inputs</em></strong> section below for more information about how inputs work.</p><p>You can also use the Github API to create a workflow_dispatch event as an alternative way to trigger the action from a script or something else external. This endpoint includes the ability to specify the values for inputs, making it useful to trigger the action based off a non-repository related event.</p><p><strong>inputs</strong>: This key is a child of the workflow_dispatch key. Any child of inputs is some sort of input (e.g. string, boolean, choice, etc) that can be used with manual execution. For example, you might have an action that posts a comment to a pull request. You can use a string input to specify whichever pull request you want, or use a choice input to select a certain pull request number via a list.</p><p><strong>jobs:</strong> Jobs are units of work within a workflow. The jobs key is used to organize those jobs. Each direct child of jobs is a user-defined key whose child key stepscontains the steps for that job (see the <strong><em>user-defined job key</em></strong> section below). Individual steps it takes to do this activity compose a job. Steps are also represented by keys that have their own syntax and children (see <strong><em>Common Workflow Keys: steps</em></strong>).</p><p>A workflow can have one or multiple jobs, the latter case arising from scenarios like the complexity of your action, dependencies, and overall organization. If a workflow has multiple jobs, they run in parallel with each other unless otherwise specified or if runner availability is limited.</p><p><strong>user-defined job key:</strong> Each direct child of jobs will be a key whose name you define and can be seen as the “internal name” of that job (ex. test-job). Individual jobs have their own optional name key whose value is what will be seen in the Github Actions UI under the workflow they are associated with. (If not using name, you will see the “internal name” instead).</p><p><strong>runs-on:</strong> The runs-on key is a direct child of a job that defines what runner/OS to run the job on. This can be a Github runner or self-hosted runner. See the <strong><em>Runners</em></strong> section for more information on runners.</p><p>You are not limited to assigning one specific runner; there are ways to specify that a job is permitted to certain runners based on a quality, such as a label or group. This is further elaborated in <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/choose-the-runner-for-a-job">official documentation</a>.</p><p><strong>if:</strong> The if key is used to evaluate conditionals at job-level or step-level. If the condition evaluates as true, then that job or step will be run. If the condition evaluates as false, then that job or step will be skipped. When viewing workflow logs in the Github Actions UI, there is a visual indicator that shows if the job or step was skipped.</p><p>Using conditionals can help speed up workflows or prevent undesirable behavior from occurring. Conditionals can also be combined with designated status check functions to perform even more dynamic behavior (see <strong><em>Workflows: Using Conditionals in Workflows</em></strong>).</p><p><strong>steps:</strong> The steps key is a direct child of the user-defined internal name job key. Generally, each step is composed of a name key and a run or uses key (see similar-named sections below); other keys exist and may be present depending on the use case. Steps run in order from the top down.</p><p><strong>run:</strong> The run key is where some sort of logic is executed. This logic can be written inline shell commands or refer to a script. (Note that if you want to execute another Github Action, this is <em>not</em> done with run. Instead, utilize the uses key).</p><p><strong>uses:</strong> The uses key at step-level indicates that another action will be referenced in the step. You can call upon another action within the same repository, a different repository, or from the Github Actions Marketplace (which is also essentially a different repository). This key is often used with the with key when the action has inputs associated with it. (See the below section for info regarding with)</p><p>You can also put uses at job-level, where it can <a href="https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows">call upon another workflow</a> file. At job-level, the with key can also be used to provide inputs for that workflow.</p><p><strong>with:</strong> The with key is used in conjunction with uses to <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepswith">provide inputs to a referenced action </a>(step-level) or to <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idwith">provide inputs to a referenced workflow</a> (job-level). In either case, the children of with are key-value pairs with the key being the name of the input, and the value being the value to assign that input.</p><h4>Using Conditionals in Workflows</h4><p>As explained in the above section, the if key can be used to conditionally fire off a job or steps within that job. Github Actions also come with <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#status-check-functions">status check functions</a>, which can be used together with if at job-level or step-level. These functions — success(), failure(), cancelled(), and always() — can be used to check the status of previous steps or jobs and gracefully deal with the result.</p><p>For example, if Job A fails, and Job B is dependent on the success of Job A, then Job B shouldn’t run if Job A fails. Adding onto that, you could have Job C fire <em>only</em> when Job A fails, with Job C doing something like logging what happened during Job A.</p><h3>Runners</h3><p>Runners are virtual machines that execute the jobs and corresponding steps in a workflow. You can have a workflow run on whatever runner you want. In other words, the specificity of runner selection is determined by you. The runs-on key in a workflow is used to select which runner to use. See the <strong><em>Common Workflow Keys: runs-on</em></strong> section for more details.</p><p>Github provides runners you can utilize, or you can set up your own self-hosted runners for enhanced customizability. This section describes each briefly, along with some pros and cons.</p><h4>Github-hosted Runners</h4><p><a href="https://docs.github.com/en/actions/reference/runners/github-hosted-runners">Github-hosted runners</a> are convenient in that they are pre-configured and ready to use out of-the-box. They come with a slew of helpful tools pre-installed, like <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli">Github CLI</a>. Additionally, maintenance is completely off your hands. Generally, each time a Github-runner executes a job, it does so in a fresh environment. This means tasks such as cleanup are off your hands, making it so your jobs aren’t “contaminated” by anything. This transitory nature of the environment means less risk of leaving behind potentially sensitive data.</p><p>While there are several benefits to using Github-hosted runners, there are also drawbacks. On public repositories, Github-hosted runners are free to use. On private repositories, <a href="https://docs.github.com/en/billing/concepts/product-billing/github-actions">they are free up to a point and then subject to certain rates</a>, which can become cost-prohibitive. There is also the fact that because these runners come pre-configured, you are somewhat limited in customizing them. In a similar vein, efficiency of your workflows can be impacted if the <a href="https://docs.github.com/en/actions/reference/runners/github-hosted-runners#supported-runners-and-hardware-resources">hardware specifications for that runner</a> are not up to par, leading to bottlenecks or sluggishness. Because of the short-lived nature of environments, it can be harder to debug the pathology of certain issues. Lastly, the popularity of Github-hosted runners is a double-edged sword; because they are widely used, this can result in limited runner availability.</p><h4>Self-hosted Runners</h4><p><a href="https://docs.github.com/en/actions/concepts/runners/self-hosted-runners">Self-hosted runners</a> are an alternative to the runners provided by Github. Hosting a runner independently allows for more customizability, which an be particularly useful if dealing with older or niche OS. Additionally, it can be easier to troubleshoot certain issues since you have more interaction with the server and a persistent environment. You also don’t have to worry about availability as much since you choose who gets to use this runner. Self-hosted runners can also be more cost-effective in the long run. On top of that, you can also <a href="https://docs.github.com/en/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#limiting-the-use-of-self-hosted-runners">limit the scope of self-hosted runners to select repositories</a>.</p><p>However, just like Github-hosted runners, self-hosted runners are not without their flaws. You are responsible for all setup of the self-hosted runner and any subsequent maintenance of it. This entails all the usual fun like making sure packages are installed and keeping track of dependencies. There are also <a href="https://docs.github.com/en/actions/reference/security/secure-use#hardening-for-self-hosted-runners">security risks</a> you must account for when using self-hosted runners. Because self-hosted runners do not use a transient environment, you also must make sure to use cleanup logic to prevent previous runs from affecting later ones.</p><h3>Github Actions UI</h3><p>The GitHub Actions UI is a browser-based GUI used to interact with actions in some way. The most two common applications of it are <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow">manually running</a> actions and <a href="https://docs.github.com/en/actions/how-tos/monitor-workflows/view-workflow-run-history">viewing information</a> regarding actions that have been fired off. An ongoing/completed action in this context can be referred to as a <em>workflow run</em>.</p><p>The main page of the GitHub Actions UI can be accessed by hitting the <em>Actions</em> button at the top of the Github browser page for that repository.</p><h4>Viewing Workflow Runs</h4><p>When you first access the main page, you will see all the workflow runs for that repository. In the left <em>Workflows</em> sidebar you can click a particular workflow to go to a new page where all the runs that have been executed for that workflow can be seen. (Note: The name of the workflow seen here is determined by the workflow-level name key. If no name key is used, then <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#name">the filepath of the workflow (based on the root of the repository) is seen instead</a>. See <strong><em>Common Workflow Keys: name</em></strong> for more details.)</p><p>On either page, you can filter workflow runs by:</p><ul><li><em>Event</em>: The event that triggered the workflow</li><li><em>Status</em>: Workflow status (ex. Success, Failure, Skipped, Ongoing, etc.)</li><li><em>Branch</em>: The branch that triggered the workflow</li><li><em>Actor</em>: The user that triggered the workflow</li></ul><p>You can click on an individual run to view its jobs and corresponding steps. This is useful for troubleshooting workflows and gathering data about the run. (Note: The name of the job or step seen on this page is determined by the usage of the name key at job-level or step-level. See <strong><em>Common Workflow Keys: name</em></strong> for more details.)</p><h4>Manually Running a Workflow</h4><p>You can <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow">manually trigger the workflow</a> from its individual page if the workflow has the workflow_dispatch key in it (See <strong><em>Common Workflow Keys: workflow_dispatch</em></strong>). If this is the case, the web page will indicate this in a highlighted area with the text “This workflow has a workflow_dispatch event trigger.” In the same highlighted area, click the button that says <em>Run workflow</em>. This opens up a form you can utilize to assign values to inputs.</p><p>In this form, you can also choose what branch to run the workflow under via the <em>Use Workflow From</em> dropdown list. This option is always available, regardless if other inputs exist for the workflow. This option is useful when developing workflows because generally <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onworkflow_dispatch">for a workflow to be allowed to run manually, it must first be published to the main branch</a>. You can then edit that workflow on a separate branch and run it from the context of that branch using this option.</p><p>Once you’ve decided what inputs and branch to use, you can then hit the <em>Run workflow</em> button to manually trigger your workflow. The workflow run should then appear on the page. This is not an instantaneous process — you may find it easier to refresh the page to get the workflow run to appear.</p><h3>Conclusion</h3><p>Github Actions are widely customizable tasks, with a variety of triggers to execute them. The ability to define the platform on which you execute these tasks is also thematic with this customizability. After reading this article, you should have a basic comprehension of how the components of Github Actions work together to automate various activity related to code building, testing, deployment, and source control.</p><p>I hope to elaborate on some basic workflows I’ve been writing on as a companion article to this one. Look out for it! In the meantime, try Github Actions for yourself and see what you can do!</p><h3>Sources</h3><p>This section lists all the links found in various sections throughout this article. Note that some links may point to the same webpage, but a different bookmark.</p><p>The format of these links is as follows:</p><ul><li>Title of the webpage, in quotes</li><li>Name of the domain/organization, in italics</li><li>The URL to the webpage</li></ul><ol><li>“Understanding GitHub Actions”, <em>Github: </em><a href="https://docs.github.com/en/actions/get-started/understand-github-actions">https://docs.github.com/en/actions/get-started/understand-github-actions</a></li><li>“Events that trigger workflows”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows">https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows</a></li><li>“Manually running a workflow”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow">https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow</a></li><li>“Workflow syntax for GitHub Actions”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax">https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax</a></li><li>“Triggering a workflow”, <em>Github</em>: <a href="https://docs.github.com/en/enterprise-cloud@latest/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#using-multiple-events">https://docs.github.com/en/enterprise-cloud@latest/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#using-multiple-events</a></li><li>“REST API endpoints for workflows”, <em>Github</em>: <a href="https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event">https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28</a></li><li>“Understanding GitHub Actions”, <em>Github</em>: <a href="https://docs.github.com/en/actions/get-started/understand-github-actions#workflows">https://docs.github.com/en/actions/get-started/understand-github-actions#workflows</a></li><li>“YAML Tutorial : A Complete Language Guide with Examples”, <em>Spacelift.io:</em> <a href="https://spacelift.io/blog/yaml%5D">https://spacelift.io/blog/yaml%5D</a></li><li>“crontab”, <em>The Open Group Base Specifications Issue 7, 2018 edition</em>: <a href="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07">https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07</a></li><li>“Choosing the runner for a job”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/choose-the-runner-for-a-job">https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/choose-the-runner-for-a-job</a></li><li>“Reuse workflows”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows#calling-a-reusable-workflow">https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows#calling-a-reusable-workflow</a></li><li>“Evaluate expressions in workflows and actions”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#status-check-functions">https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#status-check-functions</a></li><li>“GitHub-hosted runners reference”, <em>Github</em>: <a href="https://docs.github.com/en/actions/reference/runners/github-hosted-runners">https://docs.github.com/en/actions/reference/runners/github-hosted-runners</a></li><li>“Using GitHub CLI in workflows”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli">https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli</a></li><li>“GitHub Actions billing”, <em>Github</em>: <a href="https://docs.github.com/en/billing/concepts/product-billing/github-actions">https://docs.github.com/en/billing/concepts/product-billing/github-actions</a></li><li>“Self-hosted runners”, <em>Github</em>: <a href="https://docs.github.com/en/actions/concepts/runners/self-hosted-runners">https://docs.github.com/en/actions/concepts/runners/self-hosted-runners</a></li><li>“Disabling or limiting GitHub Actions for your organization”, <em>Github</em>: <a href="https://docs.github.com/en/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#limiting-the-use-of-self-hosted-runners">https://docs.github.com/en/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#limiting-the-use-of-self-hosted-runners</a></li><li>“Secure use reference”, Github: <a href="https://docs.github.com/en/actions/reference/security/secure-use#hardening-for-self-hosted-runners">https://docs.github.com/en/actions/reference/security/secure-use#hardening-for-self-hosted-runners</a></li><li>“Viewing workflow run history”, <em>Github</em>: <a href="https://docs.github.com/en/actions/how-tos/monitor-workflows/view-workflow-run-history">https://docs.github.com/en/actions/how-tos/monitor-workflows/view-workflow-run-history</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*MUuKhUCoWRK4nRPNGgFZjw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05ca591797a5" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/getting-started-with-github-actions-05ca591797a5">Getting Started With Github Actions</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jenkins and the Parameters Directive]]></title>
            <link>https://medium.com/@mc999/jenkins-and-the-parameters-directive-0104f676d212?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/0104f676d212</guid>
            <category><![CDATA[jenkinsfile]]></category>
            <category><![CDATA[source-control-management]]></category>
            <category><![CDATA[jenkins-parameter]]></category>
            <category><![CDATA[jenkins-pipeline]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Sat, 22 Mar 2025 16:27:44 GMT</pubDate>
            <atom:updated>2025-12-17T04:55:34.559Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Storage and consistency in source control</em></p><figure><img alt="Multicolored thick lines" src="https://cdn-images-1.medium.com/max/1024/1*d2b8ZIwP64AlkHGLlZ5xiw.jpeg" /><figcaption>Why yes, I did use PowerPoint to make this cover splash.</figcaption></figure><p>If you’ve worked with Jenkins at all, you are probably familiar with parameters: convenient, user-defined modifications for your job without changing the actual definition of the job itself.</p><p>If you’re like me and suddenly got thrown into Jenkins without a lot of prior experience to its workings, you probably thought these could only be defined by the UI.</p><p>The Jenkins UI is actually pretty decent when it comes to adding and modifying parameters, although it can be a bit tedious. When you’re working with several different environments, the problem compounds itself into a time-consuming, error-prone effort. And imagine if you suddenly need to decommission or change something! Then you have to use the UI <em>again</em> for umpteen environments and double-check everything one last time. Additionally, doesn’t it seem odd that the parameters aren’t maintained in source control? Gross.</p><p>Introducing the parameters directive, a wonderful block of code that can solve all of the above issues! The parameters directive is stored in the Jenkinsfile, meaning we can now subject our parameters to source control! What’s more is that we don’t have to manually modify our parameters any longer. This article goes over how to set the directive up, as well as providing snippets you can use and copy yourself to experiment.</p><h4>Overview</h4><p>The parameters directive kind of reminds me of a list of hashes in that you list out a bunch key-value pairs that relate to a higher purpose.</p><p>Consider the following example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2abf56d79c1ec54f0ff900d2d77575ab/href">https://medium.com/media/2abf56d79c1ec54f0ff900d2d77575ab/href</a></iframe><p>See how everything has key-value pairs? It’s not <em>quite</em> a hash but analogous enough. (If you’re not familiar with hashes, for the purposes of this article you can view “keys” as a quality of something, and “values” as the value of that quality. Like hairColor: &#39;brown&#39;). It’s important to note that keys don’t need to be put in quotes. Furthermore, notice how each line within the block just ends, no need to use commas!</p><p>We’ll be breaking down this example piece by piece as we go along, reviewing each row and the expected result then run an example build and view the whole thing.</p><h4>Separator</h4><p><strong>Note:</strong> Separators aren’t available by default — you must install the <a href="https://plugins.jenkins.io/parameter-separator/"><em>Parameter Separator</em></a> plugin (otherwise, if you try to incorporate it in the directive, you will get an error saying Invalid parameter type “separator”.) . However, they’re so useful and easy to implement I wanted to mention them in this article regardless.</p><p>Separators aren’t technically parameters, they’re more like HTML header elements (e.g. &lt;h1&gt;, &lt;h2&gt;, etc.) combined with a horizontal rule (&lt;hr&gt;, basically a grey line). They don’t take user input and aren’t designed to, but are worth mentioning for organization’s sake and ease of use.</p><p>If you have a pipeline where there’s several different parameters, delineating them in some way can be useful. For example, perhaps you have parameters that have been QA’d and you know will work, but you also have parameters that are in a more experimental phase. You can use separators to better divide these.</p><p>An example of how to compose a separator can be seen below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8044e08ba0d2229cbec00d9c813dbfbd/href">https://medium.com/media/8044e08ba0d2229cbec00d9c813dbfbd/href</a></iframe><p>The name is the name of the separator. Note that the value used for this will NOT appear, it’s really more for internal reference.</p><p>The sectionHeader is the actual text that will appear in the Build page. You can choose to leave this blank depending on how you want your build page to look. If you leave it undefined, then you’ll only see the &lt;hr&gt;.</p><p>Based off the example above, the separator will look like the following after a successful build:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tUTsC5VaxbA8bR3KUNzidw.png" /><figcaption>Separator generated by the parameters directive. A nice way to break things up.</figcaption></figure><h4>String Parameter</h4><p>String parameters are somewhat analogous to HTML &lt;input&gt; elements (of type “text”), a text box where a user can type some brief string in.</p><p>An example of how to compose a string parameter can be seen below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70d4199f77f65fb62c954f5034eda5ec/href">https://medium.com/media/70d4199f77f65fb62c954f5034eda5ec/href</a></iframe><p>The name is the name of the string parameter. This will appear above the text box.</p><p>The defaultValue is the default text to put in the text box. If you don’t want any defaul text, just leave this blank (defaultValue:&#39;&#39;).</p><p>The description is grey text that appears above the text box, but below the name. It will appear as grey text that gives users context as to what the parameter does.</p><p>Based off the example above, the string parameter will look like the following after a successful build:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WgmNYQ3pln2XvRes910YfQ.png" /></figure><h4>Text Parameter</h4><p>Text parameters are very similar to string parameters in that they serve to take text input from the user. However, text parameters are more analogous to HTML &lt;textarea&gt; elements, allowing for multi-line input.</p><p>An example of how to compose a text parameter can be seen below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d39d82cada11024aa70f9c719d50943/href">https://medium.com/media/8d39d82cada11024aa70f9c719d50943/href</a></iframe><p>The name is the name of the text parameter. This will appear above the text area.</p><p>The defaultValue is the default text to put in the text area. If you don’t want any default text, just leave this blank (defaultValue:&#39;&#39;).</p><p>The description is grey text that appears above the text area, but below the name. It will appear as grey text that gives users context as to what the parameter does.</p><p>Based off the example above, the text parameter will look like the following after a successful build:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FG1LKht9g0js0ty8mjBV4w.png" /></figure><h4>Boolean Parameter</h4><p>Boolean parameters are somewhat analogous to HTML &lt;input&gt; elements of type “checkbox”, a checkbox a user can click to denote something as true or false.</p><p>An example of how to compose a boolean parameter can be seen below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6a6787c494cf48df9eb2af71faefc0a1/href">https://medium.com/media/6a6787c494cf48df9eb2af71faefc0a1/href</a></iframe><p>The name is the name of the boolean parameter. This will appear to the right of the checkbox.</p><p>The defaultValue is the default value of the boolean parameter. If this is set to true, the checkbox will be checked by default. If this is set to false, this leaves the checkbox unchecked.</p><p>The description is the description of the boolean parameter. It will appear below the checkbox as grey text that gives users context as to what the parameter does.</p><p>Based off the example above, the boolean parameter will look like the following after a successful build:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqSuHCsMfzHmokNT9WqLcA.png" /></figure><h4>Choice Parameter</h4><p>Choice parameters are somewhat analogous to HTML &lt;select&gt; elements in that they appear as a dropdown list, with the “choices ”being analogous to &lt;option&gt; elements.</p><p>An example of how to compose a choice parameter can be seen below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f9e764b9caf4f08acd0f3c67238a9cd/href">https://medium.com/media/4f9e764b9caf4f08acd0f3c67238a9cd/href</a></iframe><p>The name is the name of the choices parameter. This will appear above of the dropdown list.</p><p>The choices is list of choices for the drop down. Choices are listed in brackets [], separated via commas. Note the first choice in the list is the default — this is inherent activity, so you can’t choose to omit it like other parameters. A workaround is setting the first choice be &#39;&#39; and coding around that.</p><p>The description is the description of the choice parameter. It will appear above the dropdown as grey text that gives users context as to what the parameter does.</p><p>Based off the example above, the choices parameter will look like the following after a successful build:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LyTP0n5lZ5oko4CkfB6Xmw.png" /></figure><h4>Putting it All Together</h4><p>At this point, you have now seen a myriad of parameters, how to set them up, and an example of the results. Let’s take one more look at the whole parameters directive and its results to tie it altogether.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFeyFoAsdMkzYaktZD7vnw.png" /><figcaption>All of the parameters for the pipeline named “Basic Pipeline”</figcaption></figure><p>While this is pretty simple, it should give you a solid foundation to work into your own pipelines. Try it out!</p><h4>Sources</h4><ol><li>Jenkins Pipeline Syntax (see <em>parameters</em> section): <a href="https://www.jenkins.io/doc/book/pipeline/syntax/#parameters">https://www.jenkins.io/doc/book/pipeline/syntax/#parameters</a></li><li>Jenkins Parameter Separator Plugin: <a href="https://plugins.jenkins.io/parameter-separator/">https://plugins.jenkins.io/parameter-separator/</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*MUuKhUCoWRK4nRPNGgFZjw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0104f676d212" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Importance of the Return Keyword in Recursive JavaScript Functions]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/better-programming/importance-of-the-return-keyword-in-recursive-javascript-functions-d12203c30d1a?source=rss-f28ebaffdb32------2"><img src="https://cdn-images-1.medium.com/max/2600/0*_RBhSux8XRdV-8QI" width="5472"></a></p><p class="medium-feed-snippet">An analysis of why function calls alone aren&#x2019;t enough</p><p class="medium-feed-link"><a href="https://medium.com/better-programming/importance-of-the-return-keyword-in-recursive-javascript-functions-d12203c30d1a?source=rss-f28ebaffdb32------2">Continue reading on Better Programming »</a></p></div>]]></description>
            <link>https://medium.com/better-programming/importance-of-the-return-keyword-in-recursive-javascript-functions-d12203c30d1a?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/d12203c30d1a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[recursion]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Thu, 19 Mar 2020 18:10:52 GMT</pubDate>
            <atom:updated>2020-03-19T18:10:52.275Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Check if an Array Is Within a 2D Array Using JavaScript]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/better-programming/check-if-an-array-is-within-a-2d-array-using-javascript-c534d96cb269?source=rss-f28ebaffdb32------2"><img src="https://cdn-images-1.medium.com/max/2600/0*67wJVZtzRlKvf3ao" width="4928"></a></p><p class="medium-feed-snippet">Solving pass-by-reference with an algorithm</p><p class="medium-feed-link"><a href="https://medium.com/better-programming/check-if-an-array-is-within-a-2d-array-using-javascript-c534d96cb269?source=rss-f28ebaffdb32------2">Continue reading on Better Programming »</a></p></div>]]></description>
            <link>https://medium.com/better-programming/check-if-an-array-is-within-a-2d-array-using-javascript-c534d96cb269?source=rss-f28ebaffdb32------2</link>
            <guid isPermaLink="false">https://medium.com/p/c534d96cb269</guid>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[for-loop]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[iteration]]></category>
            <dc:creator><![CDATA[Matt Cummings]]></dc:creator>
            <pubDate>Mon, 09 Mar 2020 02:27:29 GMT</pubDate>
            <atom:updated>2020-03-09T02:27:29.746Z</atom:updated>
        </item>
    </channel>
</rss>