diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3351ff8..28db2f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,5 +53,13 @@ jobs: run: | go run cmd/gh-setup/main.go --repo k1LoW/gh-setup gh-setup -v + shell: bash + + - name: Run setup as a action (1/2) + uses: ./ + with: + repo: k1LoW/tbls + - name: Run setup as a action (2/2) + run: tbls version shell: bash diff --git a/scripts/install-gh-setup.sh b/scripts/install-gh-setup.sh index 264b4f2..856d6fa 100644 --- a/scripts/install-gh-setup.sh +++ b/scripts/install-gh-setup.sh @@ -2,6 +2,9 @@ set -e token=${GH_SETUP_GITHUB_TOKEN} +if [ -z "${token}" ]; then + token=${GITHUB_TOKEN} +fi repo="k1LoW/gh-setup" tag="$(curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${token}" https://api.github.com/repos/${repo}/releases/latest | grep tag_name | awk -F':' '{print $2}' | awk -F'\"' '{print $2}')" arch="$(uname -m)" diff --git a/scripts/run-gh-setup.sh b/scripts/run-gh-setup.sh index 6f0a5ee..67701b0 100644 --- a/scripts/run-gh-setup.sh +++ b/scripts/run-gh-setup.sh @@ -3,6 +3,9 @@ set -e bin=${GH_SETUP_BIN} token=${GH_SETUP_GITHUB_TOKEN} +if [ -z "${token}" ]; then + token=${GITHUB_TOKEN} +fi repo=${GH_SETUP_REPO} bindir=${GH_SETUP_BIN_DIR} force=${GH_SETUP_FORCE}