Create the checkout action.
This commit is contained in:
commit
c2198f225b
2 changed files with 23 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.idea/
|
||||||
22
action.yml
Normal file
22
action.yml
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue