Skip to content

Commit

Permalink
ci: add tests for password source preference for the cmdline tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatk committed Apr 29, 2024
1 parent 8fd9ed6 commit b5342a3
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,22 @@ jobs:
- name: Run go test
run: go test ./...
- name: Run go build
run: go build ./cmd/gokey
run: go build -o gokey ./cmd/gokey
- name: Command line password is preferred to a password file
if: runner.os == 'Linux'
run: |
echo -n wrong > /tmp/pass
[ $(./gokey -p hunter2 -P /tmp/pass -r test) == 'X"fZba:0S>' ]
- name: Password file is preferred to the environment variable
if: runner.os == 'Linux'
run: |
echo -n hunter2 > /tmp/pass
[ $(./gokey -P /tmp/pass -r test) == 'X"fZba:0S>' ]
env:
GOKEY_ROOT_PASS: wrong
- name: Set password through the environment variable
if: runner.os == 'Linux'
run: |
[ $(./gokey -r test) == 'X"fZba:0S>' ]
env:
GOKEY_ROOT_PASS: hunter2

0 comments on commit b5342a3

Please sign in to comment.