Skip to content

Commit

Permalink
Add option to delay execution of command for a webhook or globally
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Mar 6, 2024
1 parent ead87f0 commit 29f359e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ app.post("/", (req, res) => {
}
if (verified) {
let command = ""
// Add delay if needed
const delay = parseInt(match.delay ?? config.delay ?? 0)
if (delay) {
command += `sleep ${delay}; `
}
// Add environment variables if needed
_.forEach(match.env || {}, (env, path) => {
let value = _.get(req, path)
Expand Down

0 comments on commit 29f359e

Please sign in to comment.