-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Use hard-coded user_name in CI
The gh tool doesn't has permissions in CI and a using a hard-coded user_name is sufficient.
- Loading branch information
1 parent
fcb7885
commit 40f6c6b
Showing
2 changed files
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|