From f13c5d2f0357708d85477aabe50fd3f725528745 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 22 Nov 2024 21:59:09 +0900 Subject: [PATCH] feat: add an input to skip installing aqua (#709) * feat: add an input to skip installing aqua * fix: stop using notice command --- .github/workflows/test.yaml | 15 +++++++++++++++ action.yaml | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dda118f..8e10af8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -144,6 +144,21 @@ jobs: working-directory: tests env: GITHUB_TOKEN: ${{ github.token }} + - uses: ./ + with: + aqua_version: v2.37.0 + working_directory: tests + env: + GITHUB_TOKEN: ${{ github.token }} + - run: aqua -v + - uses: ./ + with: + aqua_version: v2.36.0 + working_directory: tests + skip_install_aqua: "true" + env: + GITHUB_TOKEN: ${{ github.token }} + - run: aqua -v test-action-container: timeout-minutes: 30 diff --git a/action.yaml b/action.yaml index 2f92fcf..ebf930b 100644 --- a/action.yaml +++ b/action.yaml @@ -20,6 +20,11 @@ inputs: If this is "true", "aqua policy allow" is run without argument. If this isn't empty and isn't "true", "aqua policy allow " is run. + skip_install_aqua: + required: false + default: "false" + description: If this true and aqua is already installed, installing aqua is skipped. + working_directory: required: false default: "" @@ -51,11 +56,16 @@ runs: if: runner.os == 'Windows' - run: | + if [ "${SKIP_INSTALL_AQUA:-}" = true ] && command -v aqua >/dev/null; then + echo "[INFO] Installing aqua is skipped" >&2 + exit 0 + fi "${GITHUB_ACTION_PATH}/aqua-installer" -v "$AQUA_VERSION" working-directory: ${{ inputs.working_directory }} shell: bash env: AQUA_VERSION: ${{ inputs.aqua_version }} + SKIP_INSTALL_AQUA: ${{ inputs.skip_install_aqua }} - run: aqua policy allow working-directory: ${{ inputs.working_directory }}