From aad9a809689c1879ac3895c3e1a84ebab0848642 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Tue, 30 Jan 2024 09:38:39 +0900 Subject: [PATCH] chore: get GitHub Access token by gh auth token (#19471) * chore: get GitHub Access token by gh auth token * ci: set AQUA_GITHUB_TOKEN * chore: add cli/cli * style: format * chore: ignore error of gh auth token --- .github/workflows/wc-test-docker.yaml | 4 ++++ aqua.yaml | 1 + scripts/run.sh | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/.github/workflows/wc-test-docker.yaml b/.github/workflows/wc-test-docker.yaml index 034c7b1803d..796deea2cfc 100644 --- a/.github/workflows/wc-test-docker.yaml +++ b/.github/workflows/wc-test-docker.yaml @@ -15,5 +15,9 @@ jobs: AQUA_GITHUB_TOKEN: ${{github.token}} - name: test GitHub Release run: cmdx t suzuki-shunsuke/mkghtag + env: + AQUA_GITHUB_TOKEN: ${{github.token}} - name: test cargo package run: cmdx t bensadeh/tailspin + env: + AQUA_GITHUB_TOKEN: ${{github.token}} diff --git a/aqua.yaml b/aqua.yaml index b2c2898f858..dd6ba524369 100644 --- a/aqua.yaml +++ b/aqua.yaml @@ -12,3 +12,4 @@ packages: - name: rhysd/actionlint@v1.6.26 - name: suzuki-shunsuke/cmdx@v1.7.4 - name: jqlang/jq@jq-1.7.1 + - name: cli/cli@v2.42.1 diff --git a/scripts/run.sh b/scripts/run.sh index d599a578ec1..07d2a45a179 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -5,6 +5,11 @@ set -eu container_name=${1:-aqua-registry} token="${AQUA_GITHUB_TOKEN:-${GITHUB_TOKEN:-}}" +if [ -z "$token" ]; then + echo "[INFO] Get a GitHub Access token by gh auth token" >&2 + # Ignore error + token=$(aqua exec -- gh auth token) || : +fi envs="" if [ -n "$token" ]; then envs="-e GITHUB_TOKEN=$token"