diff --git a/action.yml b/action.yml index 60785d5..97a7be0 100644 --- a/action.yml +++ b/action.yml @@ -5,5 +5,5 @@ runs: steps: - run: printenv shell: bash - - run: git init + - run: checkout.sh shell: bash diff --git a/checkout.sh b/checkout.sh new file mode 100755 index 0000000..4e1718a --- /dev/null +++ b/checkout.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +git init +git config --global --add safe.directory $GITHUB_WORKSPACE +git remote add origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY +git config --local http.$GITHUB_SERVER_URL/.extraheader "AUTHORIZATION: basic $(echo -n x-access-token:${{ secrets.github_token }} | base64)" +git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +$GITHUB_SHA:refs/remotes/origin/$GITHUB_REF_NAME +git sparse-checkout disable +git config --local --unset-all extensions.worktreeConfig +git checkout --progress --force -B $GITHUB_REF_NAME refs/remotes/origin/$GITHUB_REF_NAME +git log -1 --format=%H +ls -lh