forgejo-actions/action.yml

22 lines
688 B
YAML

# 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