forgejo min build env: native checkout and fetch github asset script/actions
This commit is contained in:
parent
5985d6863a
commit
790ca8c2ce
3 changed files with 128 additions and 0 deletions
39
act/checkout/action.yaml
Normal file
39
act/checkout/action.yaml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# 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')"
|
||||
git --config-env=http.extraheader=AH fetch --depth 1 origin "${{ inputs.sha }}"
|
||||
git reset --hard FETCH_HEAD
|
||||
Loading…
Add table
Add a link
Reference in a new issue