A while back I set up a Github Action to build and deploy an app on each code commit. Since it’s good practice to set an expiry date on your Personal Access Tokens, at some point they will expire and you’ll need to update them.
In my project I reference the Access Token using a Github Secret stored in the settings for the project:
To update the expired or about to expire token:
create a new Personal Access Token in your account settings
copy the new token value, update the Secrets in your project and paste the new value
After adding this and re-running, now I have a different error:
> gh-pages -d build -u 'github-actions-bot <email@example.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:
Articles online about how to enable your GitHub projects to use Codespaces are not particularly clear about how to get started, whether you need access to the beta or not, whether it is free for personal use or whether you need to pay for a subscription.
I suspect there’s been some changes since the service launched. The easiest way to open a Codespace to edit any file in your repo is to browse to a file and drop down the edit menu and then select Open in GitHub.dev
One you open a single file, the VS Code web interface will load, allowing you to edit any file in that project.