Skip to content

Commit c18603a

Browse files
authored
make rbac check non-optional (#389)
1 parent cfdc1db commit c18603a

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

action.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,11 @@ inputs:
7171
description: Disable locking
7272
required: false
7373
default: 'false'
74-
policy-check-enabled:
75-
description: Enable policy check
74+
digger-token:
75+
description: Digger token
7676
required: false
77-
default: 'false'
78-
digger-cloud-token:
79-
description: Digger cloud token
80-
required: false
81-
digger-cloud-hostname:
82-
description: Digger cloud hostname
77+
digger-hostname:
78+
description: Digger hostname
8379
required: false
8480
default: 'https://cloud.digger.dev'
8581
setup-tfenv:
@@ -187,9 +183,8 @@ runs:
187183
PLAN_UPLOAD_DESTINATION: ${{ inputs.upload-plan-destination }}
188184
ACTIVATE_VENV: ${{ inputs.setup-checkov == 'true' }}
189185
DISABLE_LOCKING: ${{ inputs.disable-locking == 'true' }}
190-
POLICY_CHECK_ENABLED: ${{ inputs.policy-check-enabled == 'true' }}
191-
DIGGER_CLOUD_TOKEN: ${{ inputs.digger-cloud-token }}
192-
DIGGER_CLOUD_HOSTNAME: ${{ inputs.digger-cloud-hostname }}
186+
DIGGER_TOKEN: ${{ inputs.digger-token }}
187+
DIGGER_HOSTNAME: ${{ inputs.digger-hostname }}
193188
ACCUMULATE_PLANS: ${{ inputs.post-plans-as-one-comment == 'true' }}
194189
run: |
195190
cd ${{ github.action_path }}
@@ -205,9 +200,8 @@ runs:
205200
PLAN_UPLOAD_DESTINATION: ${{ inputs.upload-plan-destination }}
206201
ACTIVATE_VENV: ${{ inputs.setup-checkov == 'true' }}
207202
DISABLE_LOCKING: ${{ inputs.disable-locking == 'true' }}
208-
POLICY_CHECK_ENABLED: ${{ inputs.policy-check-enabled == 'true' }}
209-
DIGGER_CLOUD_TOKEN: ${{ inputs.digger-cloud-token }}
210-
DIGGER_CLOUD_HOSTNAME: ${{ inputs.digger-cloud-hostname }}
203+
DIGGER_TOKEN: ${{ inputs.digger-token }}
204+
DIGGER_HOSTNAME: ${{ inputs.digger-hostname }}
211205
ACCUMULATE_PLANS: ${{ inputs.post-plans-as-one-comment == 'true' }}
212206
id: digger
213207
shell: bash

cmd/digger/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,11 @@ func main() {
328328
os.Exit(0)
329329
}
330330
var policyChecker core_policy.Checker
331-
if os.Getenv("POLICY_CHECK_ENABLED") == "true" {
331+
if os.Getenv("DIGGER_TOKEN") != "" {
332332
policyChecker = policy.DiggerPolicyChecker{
333333
PolicyProvider: &policy.DiggerHttpPolicyProvider{
334-
DiggerHost: os.Getenv("DIGGER_CLOUD_HOSTNAME"),
335-
AuthToken: os.Getenv("DIGGER_CLOUD_TOKEN"),
334+
DiggerHost: os.Getenv("DIGGER_HOSTNAME"),
335+
AuthToken: os.Getenv("DIGGER_TOKEN"),
336336
HttpClient: http.DefaultClient,
337337
}}
338338
} else {

0 commit comments

Comments
 (0)