Skip to content

Commit

Permalink
add use-sudo optional parameter defaulting to false. Fixes: #85
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Solis <jsolis@gmail.com>
  • Loading branch information
jsolis committed Jun 29, 2022
1 parent 441a29e commit 2fe9b69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test-action.yml
@@ -1,6 +1,6 @@
name: test-cosign

on: [pull_request]
on: [pull_request, workflow_dispatch]

jobs:
test_cosign_action:
Expand Down Expand Up @@ -180,6 +180,7 @@ jobs:
uses: ./
with:
install-dir: /usr/bin
use-sudo: true
- name: Check install!
run: cosign version
- name: Check install dir!
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -148,6 +148,7 @@ The following optional inputs:
| --- | --- |
| `cosign-release` | `cosign` version to use instead of the default. |
| `install-dir` | directory to place the `cosign` binary into instead of the default (`$HOME/.cosign`). |
| `use-sudo` | set to `true` if `install-dir` location requires sudo privs. |

## Security

Expand Down
8 changes: 6 additions & 2 deletions action.yml
Expand Up @@ -15,6 +15,10 @@ inputs:
description: 'Where to install the cosign binary'
required: false
default: '$HOME/.cosign'
use-sudo:
description: 'set to true if install-dir location requires sudo privs'
required: false
default: 'false'
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -172,8 +176,8 @@ runs:
esac
SUDO=
if command -v sudo >/dev/null; then
SUDO=sudo
if "${{ inputs.use-sudo }}" == "true" && command -v sudo >/dev/null; then
SUDO=sudo
fi
expected_bootstrap_version_digest=${bootstrap_sha}
Expand Down

0 comments on commit 2fe9b69

Please sign in to comment.