Skip to content

Commit 52ee0bf

Browse files
Add option to run project
1 parent a03c4d6 commit 52ee0bf

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

action.yaml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@ name: 'Validate STACKIT Database ACLs'
22
description: 'A github action that uses the STACKIT API to ensure that database ACLs only allow the cluster to connect to the database instances.'
33
inputs:
44
organisation_id:
5-
description: 'The Organisation ID, to validate all Databases in your STACKIT organisation.'
6-
required: true
5+
description: 'The Organisation ID, to validate all Databases in your STACKIT organisation. Either provide organisation_id or project_id'
6+
required: false
7+
project_id:
8+
description: 'The Project ID, to validate all Databases in your STACKIT project.'
9+
required: false
10+
prod_egress_range:
11+
description: 'The CIDR Range of the production cluster'
12+
required: false
13+
non_prod_egress_range:
14+
description: 'The CIDR Range of the non-prod cluster'
15+
required: false
716
stackit_service_account_key:
817
description: "STACKIT Service Account Key to authenticate against STACKIT API"
918
required: true
1019

1120
runs:
12-
1321
using: 'composite'
1422
steps:
1523
- name: "Install Python"
@@ -39,9 +47,19 @@ runs:
3947
STACKIT_SERVICE_ACCOUNT_KEY: ${{ inputs.stackit_service_account_key }}
4048
run: |
4149
echo "$STACKIT_SERVICE_ACCOUNT_KEY" > ${{ github.action_path }}/stackit-credentials.json
42-
- name: "Validate STACKIT Database ACLs"
50+
- name: "Validate STACKIT Database ACLs in Organisation"
51+
if: ${{ inputs.organisation_id }}
4352
shell: bash
4453
run: uv run src/main.py validate-org ${{ inputs.organisation_id }}
4554
working-directory: ${{ github.action_path }}
4655
env:
47-
STACKIT_SERVICE_ACCOUNT_KEY_PATH: ${{ github.action_path }}/stackit-credentials.json
56+
STACKIT_SERVICE_ACCOUNT_KEY_PATH: ${{ github.action_path }}/stackit-credentials.json
57+
- name: "Validate STACKIT Database ACLs in Project"
58+
if: ${{ inputs.project_id }}
59+
shell: bash
60+
run: uv run src/main.py validate-projects ${{ inputs.project_id }}
61+
working-directory: ${{ github.action_path }}
62+
env:
63+
STACKIT_SERVICE_ACCOUNT_KEY_PATH: ${{ github.action_path }}/stackit-credentials.json
64+
PROD_EGRESS_RANGE: ${{ inputs.prod_egress_range }}
65+
NON_PROD_EGRESS_RANGE: ${{ inputs.non_prod_egress_range }}

0 commit comments

Comments
 (0)