Skip to content

Commit

Permalink
test: Use hard-coded user_name in CI (#524)
Browse files Browse the repository at this point in the history
The gh tool doesn't has permissions in CI and a using a hard-coded
user_name is sufficient.
  • Loading branch information
rockdaboot authored Aug 1, 2024
1 parent fcb7885 commit dc6cda6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
test:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
SSH_KEY: "./id_rsa_terraform"
TF_VAR_private_key: "./id_rsa_terraform"
TF_VAR_public_key: "./id_rsa_terraform.pub"
Expand Down
6 changes: 5 additions & 1 deletion testing/smoketest/get_username.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash -eu

: ${CI:=""}

if [ -z "$CI" ]; then
user_name="github-actions"
# The gh command is faster and not as hacky as the fallback solution
if which gh >/dev/null; then
elif which gh >/dev/null; then
user_name=$(gh api user -q ".login")
else
user_name=$(ssh -T [email protected] 2>&1|cut -d'!' -f1|cut -d' ' -f2)
Expand Down

0 comments on commit dc6cda6

Please sign in to comment.