Skip to content

Commit f946ca3

Browse files
authored
chore(run-digger-action): autoformat action.yml (#2278)
1 parent 85bfab1 commit f946ca3

File tree

1 file changed

+72
-74
lines changed

1 file changed

+72
-74
lines changed

action.yml

Lines changed: 72 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ inputs:
77
local-dev-mode:
88
description: run digger for local development?
99
required: false
10-
default: false
10+
default: "false"
1111
local-dev-cli-path:
1212
description: The path to where the compiled digger cli on the self-hosted runner exists (absolute path)
1313
required: false
14-
default: './digger'
14+
default: "./digger"
1515
ee:
1616
description: use ee cli?
1717
required: false
18-
default: 'false'
18+
default: "false"
1919
fips:
2020
description: build with fips140 standard?
2121
required: false
22-
default: 'false'
22+
default: "false"
2323
setup-aws:
2424
description: Setup AWS
2525
required: false
26-
default: 'false'
26+
default: "false"
2727
aws-access-key-id:
2828
description: AWS access key id
2929
required: false
@@ -47,7 +47,7 @@ inputs:
4747
setup-google-cloud:
4848
description: Setup google cloud
4949
required: false
50-
default: 'false'
50+
default: "false"
5151
google-auth-credentials:
5252
description: Service account key used got Google auth (mutually exclusive with 'google-workload-identity-provider' input)
5353
required: false
@@ -66,7 +66,7 @@ inputs:
6666
setup-azure:
6767
description: Setup Azure
6868
required: false
69-
default: 'false'
69+
default: "false"
7070
azure-client-id:
7171
description: Azure Client ID to be used for Azure OIDC auth
7272
required: false
@@ -79,15 +79,15 @@ inputs:
7979
setup-terragrunt:
8080
description: Setup terragrunt
8181
required: false
82-
default: 'false'
82+
default: "false"
8383
setup-opentofu:
8484
description: Setup OpenToFu
8585
required: false
86-
default: 'false'
86+
default: "false"
8787
setup-pulumi:
8888
description: Setup Pulumi
8989
required: false
90-
default: 'false'
90+
default: "false"
9191
terragrunt-version:
9292
description: Terragrunt version
9393
required: false
@@ -104,15 +104,15 @@ inputs:
104104
setup-terraform:
105105
description: Setup terraform
106106
required: false
107-
default: 'false'
107+
default: "false"
108108
terraform-version:
109109
description: Terraform version
110110
required: false
111111
default: v1.5.5
112112
configure-checkout:
113113
description: Configure checkout. Beware that this will overwrite any changes in the working directory
114114
required: false
115-
default: 'true'
115+
default: "true"
116116
upload-plan-destination:
117117
description: Destination to upload the plan to. azure, gcp, github and aws are currently supported.
118118
required: false
@@ -142,15 +142,15 @@ inputs:
142142
setup-checkov:
143143
description: Setup Checkov
144144
required: false
145-
default: 'false'
145+
default: "false"
146146
checkov-version:
147147
description: Checkov version
148148
required: false
149-
default: '3.2.22'
149+
default: "3.2.22"
150150
disable-locking:
151151
description: Disable locking (deprecated, use pr_locks on digger.yml instead)
152152
required: false
153-
default: 'false'
153+
default: "false"
154154
digger-filename:
155155
description: Alternative Digger configuration file name
156156
required: false
@@ -163,76 +163,75 @@ inputs:
163163
digger-hostname:
164164
description: Digger hostname
165165
required: false
166-
default: 'https://cloud.digger.dev'
166+
default: "https://cloud.digger.dev"
167167
digger-organisation:
168168
description: The name of your digger organisation
169169
required: false
170170
setup-tfenv:
171171
description: Setup tfenv
172172
required: false
173-
default: 'false'
173+
default: "false"
174174
post-plans-as-one-comment:
175175
description: Post plans as one comment
176176
required: false
177-
default: 'false'
177+
default: "false"
178178
reporting-strategy:
179-
description: 'comments_per_run or latest_run_comment, anything else will default to original behavior of multiple comments'
179+
description: "comments_per_run or latest_run_comment, anything else will default to original behavior of multiple comments"
180180
required: false
181-
default: 'comments_per_run'
181+
default: "comments_per_run"
182182
mode:
183-
description: 'manual, drift-detection or otherwise'
183+
description: "manual, drift-detection or otherwise"
184184
required: false
185-
default: ''
185+
default: ""
186186
no-backend:
187-
description: 'run cli-only, without an orchestrator backend'
187+
description: "run cli-only, without an orchestrator backend"
188188
required: false
189-
default: 'false'
189+
default: "false"
190190
command:
191-
description: 'digger plan or digger apply in case of manual mode'
191+
description: "digger plan or digger apply in case of manual mode"
192192
required: false
193-
default: ''
193+
default: ""
194194
project:
195-
description: 'project name for digger to run in case of manual mode'
195+
description: "project name for digger to run in case of manual mode"
196196
required: false
197-
default: ''
197+
default: ""
198198
drift-detection-slack-notification-url:
199-
description: 'drift-detection slack drift url'
199+
description: "drift-detection slack drift url"
200200
required: false
201-
default: ''
201+
default: ""
202202
drift-detection-advanced-slack-notification-url:
203-
description: 'drift-detection slack drift url (advanced mode, ee only)'
203+
description: "drift-detection slack drift url (advanced mode, ee only)"
204204
required: false
205-
default: ''
205+
default: ""
206206
cache-dependencies:
207207
description: "Leverage actions/cache to cache dependencies to speed up execution"
208208
required: false
209-
default: 'false'
209+
default: "false"
210210
terraform-cache-dir:
211211
description: "allows overriding of the terraform cache dir which defaults to ${github.workspace}/cache"
212212
required: false
213-
default: ''
213+
default: ""
214214
cache-dependencies-s3:
215215
description: "Use S3 for caching terraform/terragrunt dependencies"
216216
required: false
217-
default: 'false'
217+
default: "false"
218218
cache-dependencies-s3-bucket:
219219
description: "S3 bucket name for caching without the leading s3 (e.g. mybucket)"
220220
required: false
221-
default: ''
221+
default: ""
222222
cache-dependencies-s3-bucket-prefix:
223223
description: "S3 bucket prefix for caching (e.g. cache)"
224224
required: false
225-
default: ''
225+
default: ""
226226
cache-dependencies-s3-region:
227227
description: "AWS region for S3 cache bucket"
228228
required: false
229-
default: 'us-east-1'
230-
229+
default: "us-east-1"
231230

232231
digger-spec:
233232
description: "(orchestrator only) the spec to pass onto digger cli"
234233
required: false
235-
default: ''
234+
default: ""
236235

237236
outputs:
238237
output:
@@ -270,7 +269,7 @@ runs:
270269
- name: Set up Google Auth Using A Service Account Key
271270
uses: google-github-actions/auth@v2
272271
with:
273-
credentials_json: '${{ inputs.google-auth-credentials }}'
272+
credentials_json: "${{ inputs.google-auth-credentials }}"
274273
if: ${{ inputs.setup-google-cloud == 'true' && inputs.google-auth-credentials != '' }}
275274

276275
- name: Set up Google Auth Using Workload Identity Federation
@@ -339,14 +338,14 @@ runs:
339338
BUCKET="${{ inputs.cache-dependencies-s3-bucket }}"
340339
REGION="${{ inputs.cache-dependencies-s3-region }}"
341340
PREFIX="${{ inputs.cache-dependencies-s3-bucket-prefix }}"
342-
341+
343342
SCRIPT_PATH="${{ github.action_path }}/scripts/s3-cache-download.bash"
344343
if [ ! -f "$SCRIPT_PATH" ]; then
345344
echo "::error::S3 cache download script not found at $SCRIPT_PATH"
346345
echo "Please make sure the script exists and is properly installed."
347346
exit 1
348347
fi
349-
348+
350349
chmod +x "$SCRIPT_PATH"
351350
"$SCRIPT_PATH" "$BUCKET" "$PREFIX" "$REGION" "$TF_PLUGIN_CACHE_DIR"
352351
if: ${{ inputs.cache-dependencies-s3 == 'true' }}
@@ -395,7 +394,7 @@ runs:
395394
- name: setup go
396395
uses: actions/setup-go@v5
397396
with:
398-
go-version-file: '${{ github.action_path }}/cli/go.mod'
397+
go-version-file: "${{ github.action_path }}/cli/go.mod"
399398
cache: false
400399
if: ${{ !startsWith(github.action_ref, 'v') }}
401400

@@ -434,7 +433,6 @@ runs:
434433
mkdir -p $GITHUB_WORKSPACE/cache
435434
shell: bash
436435

437-
438436
- name: build and run digger
439437
if: ${{ !startsWith(github.action_ref, 'v') && inputs.local-dev-mode == 'false' }}
440438
shell: bash
@@ -464,28 +462,28 @@ runs:
464462
INPUT_DRIFT_DETECTION_ADVANCED_SLACK_NOTIFICATION_URL: ${{ inputs.drift-detection-advanced-slack-notification-url }}
465463

466464
NO_BACKEND: ${{ inputs.no-backend }}
467-
DEBUG: 'true'
465+
DEBUG: "true"
468466
TG_PROVIDER_CACHE: ${{ (inputs.cache-dependencies == 'true' || inputs.cache-dependencies-s3 == 'true') && 1 || 0 }}
469467
TERRAGRUNT_PROVIDER_CACHE: ${{ (inputs.cache-dependencies == 'true' || inputs.cache-dependencies-s3 == 'true') && 1 || 0 }}
470468
TF_PLUGIN_CACHE_DIR: ${{ env.TF_PLUGIN_CACHE_DIR }}
471469
TG_PROVIDER_CACHE_DIR: ${{ env.TF_PLUGIN_CACHE_DIR }}
472470
TERRAGRUNT_PROVIDER_CACHE_DIR: ${{ env.TF_PLUGIN_CACHE_DIR }}
473471
DIGGER_RUN_SPEC: ${{inputs.digger-spec}}
474472
run: |
475-
if [[ ${{ inputs.ee }} == "true" ]]; then
476-
cd $GITHUB_ACTION_PATH/ee/cli
477-
else
478-
cd $GITHUB_ACTION_PATH/cli
479-
fi
480-
if [[ ${{ inputs.fips }} == "true" ]]; then
481-
export GODEBUG=fips140=only
482-
export GOFIPS140=v1.0.0
483-
fi
484-
go build -o digger ./cmd/digger
485-
chmod +x digger
486-
PATH=$PATH:$(pwd)
487-
cd $GITHUB_WORKSPACE
488-
digger
473+
if [[ ${{ inputs.ee }} == "true" ]]; then
474+
cd $GITHUB_ACTION_PATH/ee/cli
475+
else
476+
cd $GITHUB_ACTION_PATH/cli
477+
fi
478+
if [[ ${{ inputs.fips }} == "true" ]]; then
479+
export GODEBUG=fips140=only
480+
export GOFIPS140=v1.0.0
481+
fi
482+
go build -o digger ./cmd/digger
483+
chmod +x digger
484+
PATH=$PATH:$(pwd)
485+
cd $GITHUB_WORKSPACE
486+
digger
489487
490488
- name: run digger
491489
if: ${{ startsWith(github.action_ref, 'v') && inputs.local-dev-mode == 'false' }}
@@ -525,10 +523,10 @@ runs:
525523
shell: bash
526524
run: |
527525
set -euo pipefail
528-
526+
529527
echo "🔧 Downloading Digger CLI..."
530528
echo "Runner OS: ${{ runner.os }}, Arch: ${{ runner.arch }}, Action Ref: ${actionref}"
531-
529+
532530
if [[ ${{ inputs.ee }} == "true" ]]; then
533531
if [[ ${{ inputs.fips }} == "true" ]]; then
534532
DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }}-fips"
@@ -538,9 +536,9 @@ runs:
538536
else
539537
DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${actionref}/digger-cli-${{ runner.os }}-${{ runner.arch }}"
540538
fi
541-
539+
542540
echo "Downloading from: $DOWNLOAD_URL"
543-
541+
544542
if ! curl -sL --fail "$DOWNLOAD_URL" -o digger; then
545543
echo "Failed to download Digger CLI from $DOWNLOAD_URL"
546544
echo ""
@@ -555,26 +553,26 @@ runs:
555553
echo "- Try using a different release version"
556554
exit 1
557555
fi
558-
556+
559557
if [[ ! -f digger || ! -s digger ]]; then
560558
echo "Downloaded file is empty or doesn't exist"
561559
exit 1
562560
fi
563-
561+
564562
chmod +x digger
565-
563+
566564
if [[ ! -x digger ]]; then
567565
echo "Failed to make digger executable"
568566
exit 1
569567
fi
570-
568+
571569
echo "Successfully downloaded and prepared Digger CLI"
572570
PATH=$PATH:$(pwd)
573571
cd $GITHUB_WORKSPACE
574572
digger
575573
576574
- name: run digger in local dev mode
577-
if: ${{ inputs.local-dev-mode == 'true' }}
575+
if: ${{ inputs.local-dev-mode == 'true' }}
578576
env:
579577
actionref: ${{ github.action_ref }}
580578
PLAN_UPLOAD_DESTINATION: ${{ inputs.upload-plan-destination }}
@@ -613,10 +611,10 @@ runs:
613611
set -euo pipefail
614612
615613
cd $GITHUB_WORKSPACE
616-
614+
617615
echo "🚀 Running digger..."
618616
RAW="${{ inputs.local-dev-cli-path }}"
619-
617+
620618
# Validate path to prevent command injection
621619
if [[ "$RAW" =~ [^a-zA-Z0-9_./-] ]]; then
622620
echo "❌ Invalid characters in local-dev-cli-path"
@@ -632,7 +630,7 @@ runs:
632630
633631
BIN="$DIR/digger"
634632
[[ -x "$BIN" ]] || { echo "❌ digger not executable at $BIN"; exit 1; }
635-
633+
636634
$BIN
637635
echo "✅ digger completed"
638636
@@ -649,14 +647,14 @@ runs:
649647
BUCKET="${{ inputs.cache-dependencies-s3-bucket }}"
650648
REGION="${{ inputs.cache-dependencies-s3-region }}"
651649
PREFIX="${{ inputs.cache-dependencies-s3-bucket-prefix }}"
652-
650+
653651
SCRIPT_PATH="${{ github.action_path }}/scripts/s3-cache-upload.bash"
654652
if [ ! -f "$SCRIPT_PATH" ]; then
655653
echo "::error::S3 cache upload script not found at $SCRIPT_PATH"
656654
echo "Please make sure the script exists and is properly installed."
657655
exit 1
658656
fi
659-
657+
660658
chmod +x "$SCRIPT_PATH"
661659
"$SCRIPT_PATH" "$BUCKET" "$PREFIX" "$REGION" "$TF_PLUGIN_CACHE_DIR"
662660
if: ${{ always() && inputs.cache-dependencies-s3 == 'true' }}

0 commit comments

Comments
 (0)