Skip to content

Commit caab53b

Browse files
Merge pull request #205 from shiftstack/ssh_keys_stdout
team_ssh_keys: Output to stdout
2 parents 05582d7 + b433bb3 commit caab53b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

team_ssh_keys.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
2-
# This script will generate a temporary file with all the ssh keys of the
3-
# approvers of a given team name in the OWNERS_ALIASES file of a given project.
4-
# The script will return the path of the temporary file.
2+
# This script returns the ssh keys of the approvers of a given team name in the
3+
# OWNERS_ALIASES file of a given project.
54
# The script will return 1 if the script fails to curl the OWNER_ALIASES file
65
# or if the yq command is not found.
76

@@ -23,11 +22,8 @@ if [ -z "$OWNER_ALIASES" ]; then
2322
fi
2423

2524
# shellcheck disable=SC2016
26-
MEMBERS=$(echo "$OWNER_ALIASES" | yq --arg team_name "$TEAM_NAME" -r '.aliases[$team_name] | join(" ")')
25+
MEMBERS=$(yq --arg team_name "$TEAM_NAME" -r '.aliases[$team_name] | join(" ")' <<< "$OWNER_ALIASES")
2726

28-
TMP_FILE=$(mktemp)
2927
for member in $MEMBERS; do
30-
curl -s "https://github.com/$member.keys" >> "$TMP_FILE"
28+
curl -s "https://github.com/$member.keys"
3129
done
32-
33-
echo "$TMP_FILE"

0 commit comments

Comments
 (0)