gp-pages deploy fails when run from GitHub Action: Author identity unknown

I’m calling gh-pages from a GitHub Action, and at the point when gh-pages is called by the Action, it fails with this error:

> gh-pages -d build

Author identity unknown

*** Please tell me who you are.

Following this recommendation on a similar posted issue, I updated the ‘npm run build’ script in my package.json to pass the -u option with the github-actions-bot userid:

    "deploy": "gh-pages -d build -u 'github-actions-bot <support+actions@github.com>'",

After adding this and re-running, now I have a different error:

> gh-pages -d build -u 'github-actions-bot <support+actions@github.com>'

fatal: could not read Username for 'https://github.com': No such device or address

Apparently to allow the Action to use actions/checkout to access your repo you must use a Personal Token per additional instructions here.

To create a new access token, access your account settings, then Developer Settings:

To add the token value as a secret to your project, add a new secret via settings on the repo that your Action is accessing:

After paying more attention to the Action log, the checkout step was actually working and completing as expected, it was the ‘npm run deploy’ step that was failing with same error as shown in the linked post above. Following the same advice to use the access token to resolve the ‘Could not read username’ error, I updated the ci.yml again to add the reference to the token as part of setting the remote repo url:

- name: Deploy
  env:
    MY_EMAIL: kevin.hooke@gmail.com
    MY_NAME: kevinhooke
  run: |
    git config --global user.email $MY_EMAIL
    git config --global user.name $MY_NAME
    git remote set-url origin https://$MY_NAME:${{ secrets.GH_SECRET }}@github.com/kevinhooke/my-example-project.git
    npm run deploy
  • the git config steps set the git user’s email and name properties within the context of the Github Action
  • the ‘git remote set-url’ specifies the repo url including my userid and the Personal Access Token retrieved from the GitHub Secret.

Problem solved, now the action works as expected and publishes this project’s GitHub pages on every commit!

Principals and techniques are more valuable that specific skills

It seems like everyone wants to learn to program and become a developer nowdays, which is great, but there’s a noticeable trend online of people asking how to learn language xyz in the shortest amount of time imaginable and get a job by next month, which is a completely unrealistic expectation.

We all have bills to pay, I get it. However, whereas learning how to build a simple HTML page today may get you your first job and keep you busy for a few months, it may not keep you employed for long if you’re not prepared to keep your skills up to date and keep up with the industry trends.

Technologies in software development change quick. What’s hot this year may be out of date the next year. You need to commit to investing in keeping your skills up to date and to stay current with the current skill demands. If you’re a relatively new developer or are just getting started, it would help to do some research about programming languages and frameworks to get an understanding of how quickly things have changed in the past. In the early 2000s for example, every Java based web application was built with Apache Struts and it was replaced with Spring MVC (and a few others) in the space of a couple of years. Web frameworks have a significantly quick turnover. JavaScript based web frameworks and libraries have come and gone in the last few years at an alarming rate – jQuery used to be everywhere and is now is a second choice (or not even considered) over the main frameworks dominating this space, Angular, React and Vue.

It’s important to keep in perspective that programming languages are tools, and learning a programming language alone does not make you a developer. A comparison is learning to use a hammer when intending to get a job as a framer building houses – it’s more obvious to see how ridiculous that expectation is, but the same thing applies to only learning a programming language.

Principals and techniques are reusable and transferrable skills, no matter what programming language you are using. Focus on developing your software development skills first, and secondly a programming language.

A career in software development is a career of continual learning and keeping your skills up to date. Regularly invest in your skills and you’ll be able to enjoy a long and rewarding career in software development.

Planning to migrate my AWS Lambda Twitter bots to Mastodon

Like everyone else right now, I’m mulling options to migrate away from Twitter, likely to Mastodon (follow me at @kevinhooke@mastodon.social !). Moving my personal usage is relatively simple, other than rebuilding a list of people and tags that I like to follow. I also have a number of Twitter bots running on AWS Lambdas that I’ve built over the years that I should move at some point.

The easy part is that the code that’s running as an AWS Lambda doesn’t need to physically move anywhere, that can continue to run where it is. The part that needs to change is the APIs it’s using to integrate with Twitter and update them to use APIs to post to Mastodon instead.

I’m still in early stage of looking at options so far. I’ve discovered there’s a Mastodon instance, BotsInSpace, that’s specifically for running bots, so that addresses that first step, where they need to run against. I’ve also been reading through a few articles on developing bots for Mastodon such as this one. So far looks like it shouldn’t be too much of a big deal to move them across.

XCode Command Line Tools no longer working after upgrade to MacOS Ventura (quick fix!)

This seems to be a recurring issue after every major OS update. You need to reinstall XCode and the Command Line Tools to get them working again.

Trying a ‘git status’ after upgrading to Ventura over the weekend, I get this error:

 > git status
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

To fix this you need to reinstall the XCode Command Line Tools (described here) with:

xcode-select --install

Press Install when prompted:

After the install completes, restart your Terminal and you should be good to go.