We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db3942b commit d53b570Copy full SHA for d53b570
add-default-github-hooks.sh
@@ -1,7 +1,8 @@
1
#!/bin/sh
2
3
# Use this script to add the IRC and Jenkins webhooks to the GitHub repositories.
4
-# You will need to add credentials to your $HOME/.netrc for this to work.
+# You will need to add credentials to your $HOME/.netrc for this to work. And if
5
+# you use two-factor authentication, you'll also need to pass GITHUB_TWO_FACTOR.
6
7
die () {
8
echo "$*" >&2
@@ -13,8 +14,9 @@ die "Usage: $0 <org>/<repository>"
13
14
15
repository="$1"
16
17
+TWO_FACTOR_HEADER="${GITHUB_TWO_FACTOR:+X-GitHub-OTP: }$GITHUB_TWO_FACTOR"
18
mycurl () {
- curl --netrc "$@" "$url"
19
+ curl --netrc --header "$TWO_FACTOR_HEADER" "$@" "$url"
20
}
21
22
url="https://api.github.com/repos/$repository/hooks"
0 commit comments