Skip to content

Commit 0f6a568

Browse files
committed
Check that an API key is provided
1 parent 5b1120f commit 0f6a568

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Ensure cURL returns an error on a failed request
1313

14+
### Fixed
15+
16+
- Check that a value was provided for the API key
17+
1418
## [0.0.1] - 2020-04-17
1519

1620
### Added

hooks/command

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ main() {
55
local datadog_host="${BUILDKITE_PLUGIN_CREATE_DATADOG_EVENT_DATADOG_HOST:-https://api.datadoghq.com}"
66
local api_key="${BUILDKITE_PLUGIN_CREATE_DATADOG_EVENT_API_KEY}"
77

8+
if [[ -z "$api_key" ]]; then
9+
echo "no API key was provided"
10+
exit 1
11+
fi
12+
813
curl -fsS -X POST \
914
-H "Content-type: application/json" \
1015
-H "DD-API-KEY: ${api_key}" \

0 commit comments

Comments
 (0)