/not-so-infinite-codespaces

Use GitHub Codespaces as if there was no timeout

not-so-Infinite Codespaces

Use GitHub Codespaces as if there was no timeout

Disclaimer

Take into account that GitHub Codespaces is a paid feature. More information.

12h timeout

There's a 12h timeout I didin't take into account while developing this. Be aware that an instance will be shut down after 12h of use.

Set up

  • Fork this repository
  • Go to the Actions tab and disable Infinite Codespaces Executor for option_id (... > Disable workflow)
  • Go to Settings > Secrets > Actions and create:
    • CODESPACES_PAT with the value of a Personal Access Token (Account settings > Developer settings > Personal access tokens > Legacy tokens) with workflow, read:org and codespace scopes. Configure the SSO for the token if you are planning to use organization-owned codespaces.
    • SSH_PRIVATE_KEY with the value of your private SSH key (your GitHub account's private pair). If you do not have a public key configured in your GitHub account, go to the SSH settings and import one.
  • Go to the Codespaces settings and set Default idle timeout to 240 minutes.

Disable Codespace timeout

  • Go to the Actions tab > Infinite Codespaces Manager
  • Click Run workflow and fill the form.

image

  • Self delete executor once the Codespace has been shut down means that, if you manually shut down (or delete) the Codespaces instance, the Action will delete itself.