Skip to content

Commit 941682e

Browse files
authored
fix(examples): webhook-github-app multiple character args (#3625)
## What * Change to `webhook-github-app` to use single character options ## Why The module fails silently, but bash `getopts` does not support multicharacter options this changes that to use single character options instead. ## References * fixes: #3556 * https://stackoverflow.com/questions/3975004/how-to-make-a-multi-character-parameter-in-unix-using-getopt * https://unix.stackexchange.com/questions/684717/how-to-use-getopts-in-bash * https://stackoverflow.com/questions/402377/using-getopts-to-process-long-and-short-command-line-options
1 parent c54e8c8 commit 941682e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

modules/webhook-github-app/bin/update-app.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ usages() {
2323
echo " -a APP_ID GitHub App ID" >&2
2424
echo " -k APP_PRIVATE_KEY_BASE64 Base64 encoded private key of the GitHub App" >&2
2525
echo " -f APP APP_PRIVATE_KEY_FILE Path to the private key of the GitHub App" >&2
26-
echo " -we WEBHOOK_ENDPOINT Webhook endpoint" >&2
27-
echo " -ws WEBHOOK_SECRET Webhook secret" >&2
26+
echo " -e WEBHOOK_ENDPOINT Webhook endpoint" >&2
27+
echo " -s WEBHOOK_SECRET Webhook secret" >&2
2828
echo " -h Show this help message" >&2
2929
exit 1
3030
}
3131

3232
# hadd h flag to show help
33-
while getopts a:f:k:ws:we:h flag
33+
while getopts a:f:k:s:e:h flag
3434
do
3535
case "${flag}" in
3636
a) APP_ID=${OPTARG};;
3737
f) APP_PRIVATE_KEY_FILE=${OPTARG};;
3838
k) APP_PRIVATE_KEY_BASE64=${OPTARG};;
39-
we) WEBHOOK_ENDPOINT=${OPTARG};;
40-
ws) WEBHOOK_SECRET=${OPTARG};;
39+
e) WEBHOOK_ENDPOINT=${OPTARG};;
40+
s) WEBHOOK_SECRET=${OPTARG};;
4141
h) usages ;;
4242
esac
4343
done

modules/webhook-github-app/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resource "null_resource" "update_app" {
66

77
provisioner "local-exec" {
88
interpreter = ["bash", "-c"]
9-
command = "${path.module}/bin/update-app.sh -we ${var.webhook_endpoint} -ws ${var.github_app.webhook_secret} -a ${var.github_app.id} -k ${var.github_app.key_base64}"
9+
command = "${path.module}/bin/update-app.sh -e ${var.webhook_endpoint} -s ${var.github_app.webhook_secret} -a ${var.github_app.id} -k ${var.github_app.key_base64}"
1010
on_failure = continue
1111
}
1212
}

0 commit comments

Comments
 (0)