move checkout action to separate path

This commit is contained in:
Manuel Friedli 2026-03-13 11:23:53 +01:00
parent 21dc8d233d
commit 8831df1d50
Signed by: manuel
GPG key ID: 41D08ABA75634DA1

22
checkout/action.yml Normal file
View file

@ -0,0 +1,22 @@
# SPDX-License-Identifier: GPL-3.0-or-later
name: 'Checkout git repository'
author: 'Manuel Friedli'
description: |
Checkout a git repository.
It performs a shallow checkout and does not require NodeJS to run.
inputs:
hostname:
description: The hostname of the forge we're checking out from.
default: "gittr.ch"
runs:
using: "composite"
steps:
- run: |
set -eu
git init --quiet --initial-branch main
git remote add origin "https://${{ forge.token }}@${{ inputs.hostname }}/${{ forge.repository }}.git"
git fetch --quiet --no-tags --depth=1 origin "${{ forge.sha }}"
git checkout --quiet "${{ forge.sha }}"
shell: bash