Teacake Tech

Technology, software development and virtual events from Scotland

Forgejo (and Codeberg) Actions

Gotcha when checking out your repository

If you come from GitHub Actions, you may be tempted to use the standard use script to check out the git repository.

Example:

  - uses: actions/checkout@v7

However, this is written in TypeScript, so if you don't have Node installed in whatever image you are using for your runner it will fail with an executable file ``node`` not found in $PATH error.

If your repository is public:

Fortunately, far more images have git installed than do node and if so there is an easy fix - just use git directly:

    steps:
    - name: Clone repo
      run: git clone --depth 1 ${{ forgejo.server_url }}/${{ forgejo.repository }} -b ${{ forgejo.ref_name }} .

The reference for the forgejo variable is here.

This is fast to run and doesn't require installing more tools during runtime. This is important because on Codeberg the run times are limited, so the more you can use tools which are already included in the image the better.

And if your image doesn't have git installed, it may be faster and use less data to install git than install node.

If your repository is private: we haven't tested what to do in this case.

ps. GitHub Actions checkout is also written in TypeScript, but we think because of how people use images there they are less likely to hit this problem.

We keep some technical notes on the tools we use. While they are primarily intended for us as we work, we thought we would share them with others. If anything is wrong here, please contact us!
Last Updated Sun 15 Nov 2026