Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 85393b7

Browse files
committed
add option to suppress certificate validation
1 parent 691595a commit 85393b7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ A [Concourse](http://concourse.ci/) [resource](http://concourse.ci/resources.htm
1010
* `branch` - the branch currently being monitored (default: `master`)
1111
* `context` - a label to differentiate this status from the status of other systems (default: `default`)
1212
* `endpoint` - GitHub API endpoint (default: `https://api.github.com`)
13+
* `skip_ssl_verification` - Disable certificate validation for GitHub API calls (default: `false`)
1314

1415

1516
## Behavior

bin/common.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ load_source () {
2525
"source_access_token": .source.access_token,
2626
"source_branch": ( .source.branch // "master" ),
2727
"source_context": ( .source.context // "default" ),
28-
"source_endpoint": ( .source.endpoint // "https://api.github.com" )
28+
"source_endpoint": ( .source.endpoint // "https://api.github.com" ),
29+
"skip_ssl_verification": ( .source.skip_ssl_verification // "false" )
2930
} | to_entries[] | .key + "=" + @sh "\(.value)"
3031
' < /tmp/stdin )
3132
}
@@ -42,5 +43,10 @@ buildtpl () {
4243
}
4344

4445
curlgh () {
45-
curl -s -H "Authorization: token $source_access_token" $@
46+
if $skip_ssl_verification; then
47+
skip_verify_arg="-k"
48+
else
49+
skip_verify_arg=""
50+
fi
51+
curl $skip_verify_arg -s -H "Authorization: token $source_access_token" $@
4652
}

0 commit comments

Comments
 (0)