<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/atom.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Posts tagged: github</title>
  <id>https://waylonwalker.com/tags/github/atom.xml</id>
  <updated>2025-12-07T10:55:55Z</updated>
  <subtitle>All posts with the tag &#34;github&#34;</subtitle>
  <link href="https://waylonwalker.com/tags/github/" rel="alternate" type="text/html"></link>
  <link href="https://waylonwalker.com/tags/github/atom.xml" rel="self" type="application/atom+xml"></link>
  <author>
    <name>Waylon Walker</name>
  </author>
  <generator uri="https://github.com/WaylonWalker/markata-go">markata-go</generator>
  <entry>
    <title>gh auth switch</title>
    <id>https://waylonwalker.com/gh-auth-switch/</id>
    <updated>2025-12-07T10:55:55Z</updated>
    <published>2025-12-07T10:55:55Z</published>
    <link href="https://waylonwalker.com/gh-auth-switch/" rel="alternate" type="text/html"></link>
    <summary type="text">When using two GitHub accounts the gh cli gives very easy workflow from the cli.</summary>
    <content type="html">&lt;p&gt;When using two GitHub accounts the gh cli gives very easy &lt;code&gt;gh auth switch&lt;/code&gt; workflow from the cli.&lt;/p&gt;&#xA;&lt;div class=&#34;admonition hint&#34;&gt;&#xA;&lt;p class=&#34;admonition-title&#34;&gt;from the docs&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;gh auth switch –help&#xA;Switch the active account for a GitHub host.&lt;/p&gt;&#xA;&lt;p&gt;This command changes the authentication configuration that will&#xA;be used when running commands targeting the specified GitHub host.&lt;/p&gt;&#xA;&lt;p&gt;If the specified host has two accounts, the active account will be switched&#xA;automatically. If there are more than two accounts, disambiguation will be&#xA;required either through the &lt;code&gt;--user&lt;/code&gt; flag or an interactive prompt.&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# list accounts&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;gh auth status&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# switch accounds (interactive if more than 2, i&amp;#39;ve never seen this personally)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;gh auth switch&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
    <author>
      <name>Waylon Walker</name>
      <email>hello@waylonwalker.com</email>
      <uri>https://waylonwalker.com</uri>
    </author>
  </entry>
  <entry>
    <title>💭 jpillora/installer: One-liner for installing binaries from Git...</title>
    <id>https://waylonwalker.com/thought-115/</id>
    <updated>2023-09-23T00:59:09Z</updated>
    <published>2023-09-23T00:59:09Z</published>
    <link href="https://waylonwalker.com/thought-115/" rel="alternate" type="text/html"></link>
    <summary type="text">!https://github.com/jpillora/installer</summary>
    <content type="html">&lt;div class=&#34;embed-card embed-card-external&#34;&gt;&#xA;  &lt;a href=&#34;https://github.com/jpillora/installer&#34; class=&#34;embed-card-link&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &lt;div class=&#34;embed-card-image&#34;&gt;&#xA;      &lt;img class=&#34;glightbox&#34; src=&#34;https://opengraph.githubassets.com/9089fd8c6e317b93bf36115eaafa985dddfd346a255809da257f56c3c8debe1e/jpillora/installer&#34; alt=&#34;GitHub - jpillora/installer: One-liner for installing binaries from Github releases — One-liner for installing binaries from Github releases - jpillora/installer&#34; loading=&#34;lazy&#34;/ data-glightbox=&#34;description: GitHub - jpillora/installer: One-liner for installing binaries from Github releases — One-liner for installing binaries from Github releases - jpillora/installer&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &lt;div class=&#34;embed-card-content&#34;&gt;&#xA;      &lt;div class=&#34;embed-card-title&#34;&gt;GitHub - jpillora/installer: One-liner for installing binaries from Github releases&lt;/div&gt;&#xA;      &lt;div class=&#34;embed-card-description&#34;&gt;One-liner for installing binaries from Github releases - jpillora/installer&lt;/div&gt;&#xA;      &lt;div class=&#34;embed-card-meta&#34;&gt;GitHub · github.com&lt;/div&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;This is a sick looking bash script generator for installing binaries off of github releases.  it reccomends curl into bash, but you could curl into install.sh  and toss that in your dotfiles repo or wherever.&lt;/p&gt;&#xA;&lt;p&gt;Install installer with installer&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl -s https://i.jpillora.com/installer &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; bash&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&#34;admonition note&#34;&gt;&#xA;&lt;p class=&#34;admonition-title&#34;&gt;Note&lt;/p&gt;&#xA;&lt;p&gt;This post is a &lt;a href=&#34;/thoughts/&#34; class=&#34;wikilink&#34; data-title=&#34;Thoughts&#34; data-description=&#34;These are generally my thoughts on a web page or some sort of url, except a rare few don&amp;#39;t have a link. These are dual published off of my...&#34; data-date=&#34;2024-04-01&#34; data-preview=&#34;These are generally my thoughts on a web page or some sort of url, except a rare few don&amp;#39;t have a link. These are dual published off of my...&#34;&gt;thought&lt;/a&gt;. It’s a short note that I make&#xA;about someone else’s content online &lt;a href=&#34;/tags/thoughts/&#34; class=&#34;hashtag-tag&#34; data-tag=&#34;thoughts&#34; data-count=&#34;2&#34; data-reading-time=&#34;3&#34; data-reading-time-text=&#34;3 minutes&#34;&gt;#thoughts&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;</content>
    <author>
      <name>Waylon Walker</name>
      <email>hello@waylonwalker.com</email>
      <uri>https://waylonwalker.com</uri>
    </author>
  </entry>
  <entry>
    <title>dash e your github docker actions</title>
    <id>https://waylonwalker.com/fail-ci-scripts/</id>
    <updated>2022-12-07T13:09:37Z</updated>
    <published>2022-12-07T13:09:37Z</published>
    <link href="https://waylonwalker.com/fail-ci-scripts/" rel="alternate" type="text/html"></link>
    <summary type="text">Give github actions the -e flag in the shebang so they fail on any one command failure. Otherwise each line will set the exit status, but only the last one...</summary>
    <content type="html">&lt;p&gt;Give github actions the -e flag in the shebang &lt;code&gt;#!&lt;/code&gt; so they fail on any one&#xA;command failure. Otherwise each line will set the exit status, but only the&#xA;last one will be passed to ci.&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#!/bin/bash -e&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;what-is--e&#34;&gt;What is -e &lt;a href=&#34;#what-is--e&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;The -e flag to the bash command allows your script to exit immediately if any&#xA;command within the script returns a non-zero exit status. This can be useful&#xA;for ensuring that your script exits with an error if any of the commands it&#xA;runs fail, which can help you identify and debug issues in your script. For&#xA;example, if you have a script that runs several commands and one of those&#xA;commands fails, the script will continue running without the -e flag, but will&#xA;exit immediately if the -e flag is present. This can make it easier to&#xA;troubleshoot your script and ensure that it runs correctly.&lt;/p&gt;&#xA;&lt;h2 id=&#34;solution-for-windows&#34;&gt;Solution for Windows &lt;a href=&#34;#solution-for-windows&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;In windows the solution is not quite as simple. You can define a function in a&#xA;Windows batch script that wraps an if statement to check the exit status of a&#xA;command and handle any errors that may have occurred. Here is an example of how&#xA;you might define a function called “check_error” that does this:&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;check_error&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;errorlevel&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;echo&lt;/span&gt; An error occurred!&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;exit&lt;/span&gt; /b 1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To use this function in your script, you would simply call it after running a&#xA;command, like this:&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;some_command&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;call&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;check_error&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This would run the “some_command” and then call the “check_error” function to&#xA;check the exit status and handle any errors that may have occurred. This&#xA;approach allows you to reuse the error-checking logic in your script, which can&#xA;make it easier to write and maintain.&lt;/p&gt;&#xA;</content>
    <author>
      <name>Waylon Walker</name>
      <email>hello@waylonwalker.com</email>
      <uri>https://waylonwalker.com</uri>
    </author>
  </entry>
</feed>