Skip to content

Commit e1c74ef

Browse files
committed
format
1 parent b01b03d commit e1c74ef

File tree

156 files changed

+2086
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+2086
-331
lines changed

.github/workflows/mod-tidy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main]
66
paths-ignore:
7-
- '**.md' # Ignore markdown files changes
7+
- "**.md" # Ignore markdown files changes
88

99
jobs:
1010
dump_contexts_to_log:
@@ -38,7 +38,7 @@ jobs:
3838
name: ${{ matrix.working-directory }} tidy
3939
strategy:
4040
matrix:
41-
include: [ { working-directory: "." } ]
41+
include: [{ working-directory: "." }]
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Dump job context
@@ -66,7 +66,7 @@ jobs:
6666

6767
- name: Tidy Go modules in multiple directories
6868
run: |
69-
set -ex -o pipefail
69+
set -Eexuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
7070
7171
dirs=("src/graph")
7272
@@ -83,5 +83,5 @@ jobs:
8383
- name: Auto commit changes
8484
uses: stefanzweifel/git-auto-commit-action@v4
8585
with:
86-
commit_message: 'Maintain: Update go.mod and generated files'
86+
commit_message: "Maintain: Update go.mod and generated files"
8787
branch: ${{ github.head_ref }}

.shellcheckrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ external-sources=true
7373

7474
# enable:
7575
# enable=add-default-case,avoid-nullary-conditions,check-extra-masked-returns,check-set-e-suppressed,check-unassigned-uppercase,deprecate-which,quote-safe-variables,require-double-brackets,require-variable-braces
76-
enable: all
77-
disable: require-variable-braces
76+
enable=all
77+
disable="require-variable-braces"

infra/dns/apply.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -exuo pipefail
3+
set -Eexuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
44

55
TF_PARALLELISM="${TF_PARALLELISM:-1}"
66
echo "TF_PARALLELISM: $TF_PARALLELISM"

infra/dns/apply_skip_plan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -exuo pipefail
3+
set -Eexuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
44

55
TF_PARALLELISM="${TF_PARALLELISM:-1}"
66
echo "TF_PARALLELISM: $TF_PARALLELISM"

infra/dns/cleanup_lock.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -exuo pipefail
3+
set -Eexuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
44

55
echo "\$0=$0"
66
script_name="$0"

infra/dns/cleanup_terraform.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -exuo pipefail
3+
set -Eexuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
44

55
RM_ALL_TFSTATE_FILES=false
66
if [ "${1:-}" == "all" ] || [ "${1:-}" == "--all" ]; then

infra/dns/cleanup_terraform_tfstate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -exuo pipefail
3+
set -Eexuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
44

55
RM_ALL_TFSTATE_FILES=false
66
if [ "${1:-}" == "all" ] || [ "${1:-}" == "--all" ]; then

infra/dns/compress_logs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
set -exuo pipefail
2+
set -Eexuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
33

44
echo "\$0=$0"
55
script_name="$0"

infra/dns/delete_all_dns_records.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -exuo pipefail
3+
set -Eexuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
44
# "NS" # DO NOT DELETE THIS
55
# "SOA" # CAN ONLY DELETE BY ID
66
types=("A" "AAAA" "ALIAS" "CNAME" "MX" "PTR" "TXT")
@@ -9,7 +9,7 @@ subdomains=("www" "blog" "mail")
99
echo "\$0=$0"
1010
script_name="$0"
1111
while [[ "$script_name" == -* ]]; do
12-
script_name="${script_name#-}"
12+
script_name="${script_name#-}"
1313
done
1414

1515
dir="$(dirname -- "$(which -- "$script_name" 2>/dev/null || realpath -- "$script_name")")"
@@ -37,7 +37,7 @@ if [ ! -f "$sops_file" ]; then
3737
exit 1
3838
fi
3939

40-
if ! command -v sops &> /dev/null; then
40+
if ! command -v sops &>/dev/null; then
4141
echo "sops not found"
4242
exit 1
4343
fi
@@ -46,13 +46,13 @@ set +x
4646

4747
sops_yaml=$(sops -d "$sops_file")
4848

49-
if ! command -v yq &> /dev/null; then
49+
if ! command -v yq &>/dev/null; then
5050
echo "yq not found"
5151
exit 1
5252
fi
5353

54-
porkbun_api_key=$(yq -r '.porkbun_api_key' <<< "$sops_yaml")
55-
porkbun_secret_key=$(yq -r '.porkbun_secret_key' <<< "$sops_yaml")
54+
porkbun_api_key=$(yq -r '.porkbun_api_key' <<<"$sops_yaml")
55+
porkbun_secret_key=$(yq -r '.porkbun_secret_key' <<<"$sops_yaml")
5656

5757
if [ -z "$porkbun_api_key" ]; then
5858
echo "porkbun_api_key not found"
@@ -64,7 +64,7 @@ if [ -z "$porkbun_secret_key" ]; then
6464
exit 1
6565
fi
6666

67-
set -x
67+
set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
6868

6969
# Retrieve DNS Records by Domain
7070
# URI Endpoint: https://api.porkbun.com/api/json/v3/dns/retrieve/DOMAIN
@@ -119,21 +119,21 @@ for domain in $domains; do
119119
retrieve_response=$(curl -X POST "https://api.porkbun.com/api/json/v3/dns/retrieve/$domain" \
120120
-H "Content-Type: application/json" \
121121
-d "{\"secretapikey\":\"$porkbun_secret_key\",\"apikey\":\"$porkbun_api_key\"}")
122-
echo "retrieve_response:\n$(jq . <<< "$retrieve_response")"
123-
jq . <<< "$retrieve_response" >> "$run_dir/$run_id.$inner_run_id.retrieve.$domain.json"
122+
echo "retrieve_response:\n$(jq . <<<"$retrieve_response")"
123+
jq . <<<"$retrieve_response" >>"$run_dir/$run_id.$inner_run_id.retrieve.$domain.json"
124124
sleep 2
125125
done
126126
for domain in $domains; do
127127
echo "domain: $domain"
128128
for type in "${types[@]}"; do
129-
echo "domain: $domain"
130-
echo "type: $type"
129+
echo "domain: $domain"
130+
echo "type: $type"
131131
inner_run_id=$(date +%s)
132132
delete_response=$(curl -X POST "https://api.porkbun.com/api/json/v3/dns/deleteByNameType/$domain/$type" \
133133
-H "Content-Type: application/json" \
134134
-d "{\"secretapikey\":\"$porkbun_secret_key\",\"apikey\":\"$porkbun_api_key\"}")
135-
echo "delete_response:\n$(jq . <<< "$delete_response")"
136-
jq . <<< "$delete_response" >> "$run_dir/$run_id.$inner_run_id.delete.$domain.$type.json"
135+
echo "delete_response:\n$(jq . <<<"$delete_response")"
136+
jq . <<<"$delete_response" >>"$run_dir/$run_id.$inner_run_id.delete.$domain.$type.json"
137137
sleep 2
138138
done
139139

@@ -148,8 +148,8 @@ for domain in $domains; do
148148
delete_response=$(curl -X POST "https://api.porkbun.com/api/json/v3/dns/deleteByNameType/$domain/$type/$subdomain" \
149149
-H "Content-Type: application/json" \
150150
-d "{\"secretapikey\":\"$porkbun_secret_key\",\"apikey\":\"$porkbun_api_key\"}")
151-
echo "delete_response:\n$(jq . <<< "$delete_response")"
152-
jq . <<< "$delete_response" >> "$run_dir/$run_id.$inner_run_id.delete.$domain.$type.$subdomain.json"
151+
echo "delete_response:\n$(jq . <<<"$delete_response")"
152+
jq . <<<"$delete_response" >>"$run_dir/$run_id.$inner_run_id.delete.$domain.$type.$subdomain.json"
153153
sleep 2
154154
done
155155
sleep 2

infra/dns/delete_tainted_resources.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
set -exuo pipefail
2+
set -Eexuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
33
echo "\$0=$0"
44
script_name="$0"
55
while [[ "$script_name" == -* ]]; do

0 commit comments

Comments
 (0)