From fb69700b06bfb50d6b138d7728e3aaa56812fdf6 Mon Sep 17 00:00:00 2001 From: ange Date: Thu, 2 May 2024 17:25:57 +0200 Subject: [PATCH] feat: simplify variables --- action.yaml | 5 ----- checkout.sh | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/action.yaml b/action.yaml index 34d1897..005c4b4 100644 --- a/action.yaml +++ b/action.yaml @@ -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 }} diff --git a/checkout.sh b/checkout.sh index 2d1253b..4b3d73c 100755 --- a/checkout.sh +++ b/checkout.sh @@ -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"