From 74123ea28a6684e95cc8f103c1baf3b783cd07dd Mon Sep 17 00:00:00 2001 From: wispem-wantex Date: Sun, 1 Jun 2025 12:45:37 -0400 Subject: [PATCH] Add input --- .gitea/workflows/test.yml | 2 ++ action.yml | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index c2a9415..d36de55 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -15,6 +15,8 @@ jobs: - name: checkout uses: https://${{ secrets.GITHUB_TOKEN }}:@git.offline-twitter.com/wispem/shellcheckout@${{ github.ref }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - name: wc -l run: wc -l action.yml diff --git a/action.yml b/action.yml index 4259d2d..403cd6a 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,9 @@ name: "Shell Checkout" description: "Checkout a repo using shell" +inputs: + github-token: + description: GitHub token runs: using: "composite" @@ -11,6 +14,8 @@ runs: mkdir -p /tmp/newdir && cd /tmp/newdir git init git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" + echo "github-token: ${{ inputs.github-token }}" + echo "token: ${token}" basicauth=$(echo -n "x-access-token:${token}" | base64) git config --local http.$GITHUB_SERVER_URL.extraheader "AUTHORIZATION: basic ${basicauth}" GIT_TRACE=1 GIT_CURL_VERBOSE=1 git fetch origin "$GITHUB_REF"