File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,23 @@ function emit_headers() {
10
10
exit 0
11
11
}
12
12
13
+ function netrc_password() {
14
+ if [ ! -e " $HOME /.netrc" ]; then
15
+ return
16
+ fi
17
+
18
+ cat $HOME /.netrc | sed -e ' s/#.*//' | awk -v host=" $1 " -v field=password ' {
19
+ if ($1 == "machine") {
20
+ found = ($2 == host);
21
+ } else if (found && ($1 == field)) {
22
+ print $2;
23
+ exit
24
+ } else if (found && $1 == "machine") {
25
+ found = false
26
+ }
27
+ }'
28
+ }
29
+
13
30
function get() {
14
31
INPUT=$1
15
32
@@ -25,7 +42,12 @@ function get() {
25
42
emit_headers " ${ENGFLOW_GITHUB_TOKEN} "
26
43
fi
27
44
28
- KEYCHAIN=" $( security find-generic-password -a selenium -s ' Selenium EngFlow' -w ) "
45
+ NETRC=" $( netrc_password github.com) "
46
+ if [ -n " ${NETRC} " ]; then
47
+ emit_headers " ${NETRC} "
48
+ fi
49
+
50
+ KEYCHAIN=" $( security find-generic-password -a selenium -s ' Selenium EngFlow' -w ) " 2> /dev/null
29
51
if [ -n " $KEYCHAIN " ]; then
30
52
emit_headers " ${KEYCHAIN} "
31
53
fi
You can’t perform that action at this time.
0 commit comments