Skip to content

Commit a4fe073

Browse files
committed
refactor: FTRS-313 Refactor GitHub workflows to enhance SonarQube security
1 parent fffeccf commit a4fe073

File tree

47 files changed

+467
-192
lines changed

Some content is hidden

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

47 files changed

+467
-192
lines changed

.github/actions/action-infrastructure-stack/action.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ runs:
4444
- name: "Action Infrastructure Stack"
4545
id: "action_stack"
4646
shell: bash
47+
env:
48+
MGMT_ACCOUNT_ID: ${{ inputs.mgmt_account_id }}
49+
ACTION: ${{ inputs.action }}
50+
STACK: ${{ inputs.stack }}
51+
ENVIRONMENT: ${{ inputs.environment }}
52+
WORKSPACE: ${{ inputs.workspace }}
53+
PROJECT: ${{ inputs.project }}
54+
RELEASE_TAG: ${{ inputs.release_tag }}
4755
run: |
48-
export MGMT_ACCOUNT_ID=${{ inputs.mgmt_account_id }}
49-
export ACTION=${{ inputs.action }}
50-
export STACK=${{ inputs.stack }}
51-
export ENVIRONMENT=${{ inputs.environment }}
52-
export WORKSPACE=${{ inputs.workspace }}
53-
export PROJECT=${{ inputs.project }}
54-
export RELEASE_TAG=${{ inputs.release_tag }}
5556
/bin/bash ./scripts/workflow/action-infra-stack.sh

.github/actions/artefact-cleardown/action.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ runs:
1414
- name: Delete artefacts
1515
id: delete_artefacts
1616
shell: bash
17+
env:
18+
WORKSPACE: ${{ inputs.workspace }}
19+
ARTEFACT_BUCKET_NAME: ${{ inputs.artefact_bucket_name }}
1720
run: |
18-
export WORKSPACE=${{inputs.workspace}}
19-
export ARTEFACT_BUCKET_NAME=${{inputs.artefact_bucket_name}}
2021
./scripts/workflow/cleardown-artefacts.sh

.github/actions/build-service/action.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ runs:
1515
steps:
1616
- name: Build Service
1717
shell: bash
18+
env:
19+
SERVICE: ${{ inputs.service }}
20+
DIRECTORY: ${{ inputs.directory }}
1821
run: |
19-
export SERVICE=${{ inputs.service }}
20-
export DIRECTORY=${{ inputs.directory }}
2122
/bin/bash ./uec-dos-management/scripts/workflow/build-service.sh

.github/actions/check-tf-state/action.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ runs:
1414
- name: Delete terraform state
1515
id: delete_tf_state
1616
shell: bash
17+
env:
18+
WORKSPACE: ${{ inputs.workspace }}
19+
ENVIRONMENT: ${{ inputs.environment }}
1720
run: |
18-
export WORKSPACE=${{inputs.workspace}}
19-
export ENVIRONMENT=${{inputs.environment}}
2021
./scripts/workflow/check-terraform-state.sh

.github/actions/cleardown-opensearch-network-policy/action.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ runs:
1515
- name: Delete OpenSearch Network Policy
1616
id: delete_os_policy
1717
shell: bash
18+
env:
19+
WORKSPACE: ${{ inputs.workspace }}
20+
STACK: ${{ inputs.stack }}
1821
run: |
19-
export WORKSPACE="${{ inputs.workspace }}"
20-
export STACK="${{ inputs.stack }}"
21-
2222
./scripts/workflow/cleardown-opensearch-network-policy.sh

.github/actions/cleardown-tf-state/action.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ runs:
1717
- name: Delete terraform state
1818
id: delete_tf_state
1919
shell: bash
20+
env:
21+
WORKSPACE: ${{ inputs.workspace }}
22+
ENVIRONMENT: ${{ inputs.environment }}
23+
STACK: ${{ inputs.stack }}
2024
run: |
21-
export WORKSPACE=${{inputs.workspace}}
22-
export ENVIRONMENT=${{inputs.environment}}
23-
export STACK=${{inputs.stack}}
2425
./scripts/workflow/cleardown-terraform-state.sh

.github/actions/create-lines-of-code-report/action.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ runs:
2424
steps:
2525
- name: "Create CLOC report"
2626
shell: bash
27+
env:
28+
BUILD_DATETIME: ${{ inputs.build_datetime }}
2729
run: |
28-
export BUILD_DATETIME=${{ inputs.build_datetime }}
2930
./scripts/reports/create-lines-of-code-report.sh
3031
- name: "Compress CLOC report"
3132
shell: bash
@@ -51,7 +52,10 @@ runs:
5152
- name: "Send the CLOC report to the central location"
5253
shell: bash
5354
if: steps.check.outputs.secrets_exist == 'true'
55+
env:
56+
BUILD_TIMESTAMP: ${{ inputs.build_timestamp }}
57+
BUCKET_ENDPOINT: ${{ inputs.idp_aws_report_upload_bucket_endpoint }}
5458
run: |
5559
aws s3 cp \
56-
./lines-of-code-report-${{ inputs.build_timestamp }}.json.zip \
57-
${{ inputs.idp_aws_report_upload_bucket_endpoint }}/${{ inputs.build_timestamp }}-lines-of-code-report.json.zip
60+
./lines-of-code-report-${BUILD_TIMESTAMP}.json.zip \
61+
${BUCKET_ENDPOINT}/${BUILD_TIMESTAMP}-lines-of-code-report.json.zip

.github/actions/deploy-service/action.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ runs:
3030
steps:
3131
- name: Deploy Service
3232
shell: bash
33+
env:
34+
SERVICE: ${{ inputs.service }}
35+
APPLICATION_ROOT_DIR: ${{ inputs.directory }}
36+
TAG: ${{ inputs.ref }}
37+
WORKSPACE: ${{ inputs.workspace }}
38+
ARTEFACT_SUB_DIR: ${{ inputs.artefact_sub_dir }}
39+
ARTEFACT_BUCKET_NAME: ${{ inputs.artefact_bucket_name }}
40+
ENVIRONMENT: ${{ inputs.environment }}
3341
run: |
34-
export SERVICE=${{ inputs.service }}
35-
export APPLICATION_ROOT_DIR=${{ inputs.directory }}
36-
export TAG=${{ inputs.ref }}
37-
export WORKSPACE=${{ inputs.workspace }}
38-
export ARTEFACT_SUB_DIR=${{ inputs.artefact_sub_dir }}
39-
export ARTEFACT_BUCKET_NAME=${{ inputs.artefact_bucket_name }}
40-
export ENVIRONMENT=${{ inputs.environment }}
4142
/bin/bash ./uec-dos-management/scripts/workflow/deploy-service.sh

.github/actions/push-tag/action.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ runs:
1414
steps:
1515
- name: Push tag
1616
shell: bash
17+
env:
18+
TAG_TO_PUSH: ${{ inputs.tag_to_push }}
19+
TAG_OVERWRITE: ${{ inputs.tag_overwrite }}
1720
run: |
18-
export TAG_TO_PUSH=${{ inputs.tag_to_push }}
19-
export TAG_OVERWRITE=${{ inputs.tag_overwrite }}
2021
. uec-dos-management/scripts/workflow/push-tag.sh

.github/actions/run-powerpipe-benchmarks/action.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,23 @@ runs:
1919
steps:
2020
- name: Create reports directory
2121
shell: bash
22+
env:
23+
REPORTS_DIR: ${{ inputs.reports-dir }}
2224
run: |
23-
mkdir -p "${{ inputs.reports-dir }}"
25+
mkdir -p "${REPORTS_DIR}"
2426
2527
- name: Run Powerpipe benchmarks
2628
shell: bash
29+
env:
30+
MODS_DIR: ${{ inputs.mods-dir }}
31+
REPORTS_DIR: ${{ inputs.reports-dir }}
32+
BENCHMARKS: ${{ inputs.benchmarks }}
2733
run: |
28-
cd "${{ inputs.mods-dir }}"
34+
cd "${MODS_DIR}"
2935
DATE=$(date +%Y-%m-%d)
3036
echo "Generating reports with date stamp: $DATE"
3137
3238
# Parse the benchmarks JSON array
33-
BENCHMARKS='${{ inputs.benchmarks }}'
3439
echo "Processing benchmarks: $BENCHMARKS"
3540
3641
# Extract benchmark count
@@ -51,7 +56,7 @@ runs:
5156
set +e
5257
powerpipe benchmark run "$BENCHMARK" \
5358
--output html \
54-
--export "../${{ inputs.reports-dir }}/aws_${NAME}_report_${DATE}.html"
59+
--export "../${REPORTS_DIR}/aws_${NAME}_report_${DATE}.html"
5560
EXIT_CODE=$?
5661
5762
if [ $EXIT_CODE -ne 0 ]; then

0 commit comments

Comments
 (0)