From 9a57e89a5e2b2d3b8d42702ba9ec796453ef4bd7 Mon Sep 17 00:00:00 2001 From: k1LoW Date: Sun, 12 Feb 2023 22:41:08 +0900 Subject: [PATCH] Add action test --- .github/workflows/ci.yml | 8 ++++++++ action.yml | 2 +- scripts/entrypoint.sh | 0 scripts/install-gh-setup.sh | 3 +++ scripts/run-gh-setup.sh | 3 +++ 5 files changed, 15 insertions(+), 1 deletion(-) mode change 100644 => 100755 scripts/entrypoint.sh mode change 100644 => 100755 scripts/install-gh-setup.sh mode change 100644 => 100755 scripts/run-gh-setup.sh 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/action.yml b/action.yml index 56d07ba..1d8cb89 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,6 @@ name: 'Setup asset of Github Releases' description: 'GitHub Action for gh-setup' -outputs: +inputs: github-token: description: The GitHub token default: ${{ github.token }} diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh old mode 100644 new mode 100755 diff --git a/scripts/install-gh-setup.sh b/scripts/install-gh-setup.sh old mode 100644 new mode 100755 index 264b4f2..856d6fa --- 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 old mode 100644 new mode 100755 index 6f0a5ee..67701b0 --- 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}