feat: simplify variables

This commit is contained in:
ange 2024-05-02 17:25:57 +02:00
parent e34fae7ab2
commit fb69700b06
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
2 changed files with 3 additions and 8 deletions

View File

@ -1,4 +1,3 @@
name: checkout
inputs:
token:
description: A token to authenticate on behalf of the GitHub App installed on your repository.
@ -10,8 +9,4 @@ runs:
- 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 }}

View File

@ -1,8 +1,8 @@
#!/bin/bash -e
URL="${ACTION_SERVER_URL/\/\//\/\/$ACTION_REPOSITORY_OWNER:$ACTION_TOKEN@}/$ACTION_REPOSITORY"
URL="${GITHUB_SERVER_URL/\/\//\/\/$GITHUB_REPOSITORY_OWNER:$ACTION_TOKEN@}/$GITHUB_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"
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin "$GITHUB_SHA"
git checkout --progress --force -B main "$GITHUB_SHA"