-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an action to create datadog downtimes (#53)
This action will create a datadog downtime to mute monitors while an application is deploying.
- Loading branch information
1 parent
618c8a7
commit 6b79698
Showing
16 changed files
with
37,484 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,20 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: 'Checkout' | ||
uses: actions/checkout@v2 | ||
|
||
- name: 'Setup node' | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: actions/create-datadog-downtime/.nvmrc | ||
cache: npm | ||
cache-dependency-path: actions/create-datadog-downtime/package-lock.json | ||
|
||
- name: 'Install dependencies' | ||
run: npm ci | ||
working-directory: actions/create-datadog-downtime | ||
|
||
- name: 'Run pre-commit' | ||
uses: pre-commit/[email protected] | ||
with: | ||
|
@@ -41,3 +55,29 @@ jobs: | |
|
||
- name: 'Run action tests' | ||
run: bats -r actions/*/*.bats | ||
|
||
node-tests: | ||
name: 'Run node unit tests' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
action: | ||
- create-datadog-downtime | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v2 | ||
|
||
- name: 'Setup node' | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: actions/${{ matrix.action }}/.nvmrc | ||
cache: npm | ||
cache-dependency-path: actions/${{ matrix.action }}/package-lock.json | ||
|
||
- name: 'Install dependencies' | ||
run: npm ci | ||
working-directory: actions/${{ matrix.action }} | ||
|
||
- name: 'Run tests' | ||
run: npm test | ||
working-directory: actions/${{ matrix.action }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# For Github Actions, we keep the dist in the source code for GHA to download and use. | ||
!dist/ | ||
|
||
## @see https://raw.githubusercontent.com/actions/checkout/main/.gitignore | ||
|
||
tests/tmp | ||
# __test__/_temp | ||
lib/ | ||
|
||
## @see https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
# dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.17.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
|
||
name: 'Post datadog downtime update' | ||
description: 'Posts a downtime window update to Datadog' | ||
|
||
inputs: | ||
scope: | ||
description: 'The scope to which the downtime applies. Must follow the [common search syntax](https://docs.datadoghq.com/logs/explorer/search_syntax/)' | ||
required: true | ||
message: | ||
description: 'A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same @username notation as events.' | ||
required: false | ||
monitor-tags: | ||
description: 'A comma delimited list of monitor tags. For example, tags that are applied directly to monitors, not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies. The resulting downtime applies to monitors that match all provided monitor tags. Setting monitor_tags to [*] configures the downtime to mute all monitors for the given scope.' | ||
required: false | ||
monitor-id: | ||
description: 'ID of the monitor to prevent notifications.' | ||
required: false | ||
end: | ||
description: 'ISO-8601 Datetime to end the downtime. Additionally, one can specify time from now as `XhXmXs`.' | ||
required: true | ||
start: | ||
description: 'ISO-8601 Datetime to start the downtime. Additionally, one can specify time from now as `XhXmXs`.' | ||
required: false | ||
|
||
# secrets | ||
datadog-api-key: | ||
description: 'The secret API key to authenticate the request with' | ||
required: true | ||
datadog-app-key: | ||
description: 'The app key to authenticate the request with (pairs with the api key)' | ||
required: true | ||
|
||
outputs: | ||
status-code: | ||
description: 'The status code of the response provided by Datadog' | ||
response: | ||
description: 'The response body provided by Datadog' | ||
|
||
runs: | ||
using: 'node20' | ||
main: dist/index.js |
Oops, something went wrong.