From 21dc8d233db446f8e739a1dfa886ac6963a05a2c Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Fri, 13 Mar 2026 11:19:20 +0100 Subject: [PATCH] Create the checkout action. --- .gitignore | 1 + action.yml | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .gitignore create mode 100644 action.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..e261ea6 --- /dev/null +++ b/action.yml @@ -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