first commit
This commit is contained in:
commit
e34fae7ab2
17
action.yaml
Normal file
17
action.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
name: checkout
|
||||||
|
inputs:
|
||||||
|
token:
|
||||||
|
description: A token to authenticate on behalf of the GitHub App installed on your repository.
|
||||||
|
default: ${{ gitea.token }}
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
run: ${{ gitea.action_path }}/checkout.sh
|
||||||
|
env:
|
||||||
|
ACTION_REPOSITORY: ${{ gitea.repository }}
|
||||||
|
ACTION_REPOSITORY_OWNER: ${{ gitea.repository_owner }}
|
||||||
|
ACTION_SERVER_URL: ${{ gitea.server_url }}
|
||||||
|
ACTION_SHA: ${{ gitea.sha }}
|
||||||
|
ACTION_TOKEN: ${{ inputs.token }}
|
8
checkout.sh
Executable file
8
checkout.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
URL="${ACTION_SERVER_URL/\/\//\/\/$ACTION_REPOSITORY_OWNER:$ACTION_TOKEN@}/$ACTION_REPOSITORY"
|
||||||
|
|
||||||
|
git init -b main
|
||||||
|
git remote add origin "$URL"
|
||||||
|
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin "$ACTION_SHA"
|
||||||
|
git checkout --progress --force -B main "$ACTION_SHA"
|
Loading…
Reference in New Issue
Block a user