2026-10-07 12:52:38 +03:00
|
|
|
# SPDX-FileCopyrightText: 2026 Vital A Pi <code@vp.ag>
|
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
name: 'Fast minimalist working copy checkout'
|
|
|
|
|
description: 'No tags, no history, no Node.js'
|
|
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
|
server_url:
|
|
|
|
|
description: 'Forgejo server URL'
|
|
|
|
|
required: true
|
|
|
|
|
default: ${{ forgejo.server_url }}
|
|
|
|
|
repository:
|
|
|
|
|
description: 'Repository path (owner/repo)'
|
|
|
|
|
required: true
|
|
|
|
|
default: ${{ forgejo.repository }}
|
|
|
|
|
sha:
|
|
|
|
|
description: 'Commit SHA to checkout'
|
|
|
|
|
required: true
|
|
|
|
|
default: ${{ forgejo.sha }}
|
|
|
|
|
token:
|
|
|
|
|
description: 'Forgejo token for authentication'
|
|
|
|
|
required: true
|
|
|
|
|
default: ${{ forgejo.token }}
|
|
|
|
|
git_object_format:
|
|
|
|
|
required: true
|
|
|
|
|
default: sha256
|
|
|
|
|
|
|
|
|
|
runs:
|
|
|
|
|
using: 'composite'
|
|
|
|
|
steps:
|
|
|
|
|
- name: Run git checkout commands
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
shopt -s dotglob
|
|
|
|
|
rm -rf *
|
|
|
|
|
git init --object-format=${{ inputs.git_object_format }} -b main .
|
|
|
|
|
git remote add origin "${{ inputs.server_url }}/${{ inputs.repository }}.git"
|
|
|
|
|
export AH="Authorization: Basic $(printf 'x-access-token:${{ inputs.token }}' | base64 | tr -d '\n')"
|
2026-10-09 13:51:29 +03:00
|
|
|
git --config-env=http.extraheader=AH fetch --depth 2 origin "${{ inputs.sha }}"
|
2026-10-07 12:52:38 +03:00
|
|
|
git reset --hard FETCH_HEAD
|