Skip to content

Commit

Permalink
feat: add an input to skip installing aqua (#709)
Browse files Browse the repository at this point in the history
* feat: add an input to skip installing aqua

* fix: stop using notice command
  • Loading branch information
suzuki-shunsuke authored Nov 22, 2024
1 parent 23c282e commit f13c5d2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <inputs.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: ""
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit f13c5d2

Please sign in to comment.