Skip to content

Commit 8ce9ff7

Browse files
authored
chore: Address zizmor findings (#42)
1 parent ee17dd8 commit 8ce9ff7

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

.github/workflows/post-merge.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525
with:
2626
fetch-depth: 0
27+
persist-credentials: false
2728

2829
- name: "Git safe directory"
2930
run: git config --global --add safe.directory $GITHUB_WORKSPACE
@@ -42,15 +43,16 @@ jobs:
4243

4344
- name: "Merge Changed Subfolders"
4445
id: merge-changed-projects
46+
env:
47+
APPS_CHANGED_PROJECTS: ${{ steps.discover-changes-apps.outputs.changed_projects }}
48+
CHARTS_CHANGED_PROJECTS: ${{ steps.discover-changes-charts.outputs.changed_projects }}
4549
run: |
4650
# TODO: Is there a better way to merge the two arrays in GHA?
47-
apps_changed_projects='${{ steps.discover-changes-apps.outputs.changed_projects }}'
48-
charts_changed_projects='${{ steps.discover-changes-charts.outputs.changed_projects }}'
49-
echo "Changed Projects in apps: $apps_changed_projects"
50-
echo "Changed Projects in charts: $charts_changed_projects"
51+
echo "Changed Projects in apps: $APPS_CHANGED_PROJECTS"
52+
echo "Changed Projects in charts: $CHARTS_CHANGED_PROJECTS"
5153
5254
# Merge the two arrays (add 'apps/' and 'charts/') and remove empty strings (if any)
53-
all_changed_projects=$(jq -c -n --argjson a "$apps_changed_projects" --argjson b "$charts_changed_projects" '
55+
all_changed_projects=$(jq -c -n --argjson a "$APPS_CHANGED_PROJECTS" --argjson b "$CHARTS_CHANGED_PROJECTS" '
5456
($a | map(select(. != "") | "apps/" + .)) +
5557
($b | map(select(. != "") | "charts/" + .))
5658
')
@@ -102,4 +104,5 @@ jobs:
102104
run_helm_push: true
103105
run_artifact: false
104106
run_version_dev: false
105-
secrets: inherit
107+
secrets: # zizmor: ignore[secrets-inherit]
108+
inherit

.github/workflows/pre-merge.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525
with:
2626
fetch-depth: 0
27+
persist-credentials: false
2728

2829
- name: "Git safe directory"
2930
run: git config --global --add safe.directory $GITHUB_WORKSPACE
@@ -45,15 +46,16 @@ jobs:
4546

4647
- name: "Merge Changed Subfolders"
4748
id: merge-changed-projects
49+
env:
50+
APPS_CHANGED_PROJECTS: ${{ steps.discover-changes-apps.outputs.changed_projects }}
51+
CHARTS_CHANGED_PROJECTS: ${{ steps.discover-changes-charts.outputs.changed_projects }}
4852
run: |
4953
# TODO: Is there a better way to merge the two arrays in GHA?
50-
apps_changed_projects='${{ steps.discover-changes-apps.outputs.changed_projects }}'
51-
charts_changed_projects='${{ steps.discover-changes-charts.outputs.changed_projects }}'
52-
echo "Changed Projects in apps: $apps_changed_projects"
53-
echo "Changed Projects in charts: $charts_changed_projects"
54+
echo "Changed Projects in apps: $APPS_CHANGED_PROJECTS"
55+
echo "Changed Projects in charts: $CHARTS_CHANGED_PROJECTS"
5456
5557
# Merge the two arrays (add 'apps/' and 'charts/') and remove empty strings (if any)
56-
all_changed_projects=$(jq -c -n --argjson a "$apps_changed_projects" --argjson b "$charts_changed_projects" '
58+
all_changed_projects=$(jq -c -n --argjson a "$APPS_CHANGED_PROJECTS" --argjson b "$CHARTS_CHANGED_PROJECTS" '
5759
($a | map(select(. != "") | "apps/" + .)) +
5860
($b | map(select(. != "") | "charts/" + .))
5961
')
@@ -86,19 +88,18 @@ jobs:
8688
run_docker_build: true
8789
run_helm_build: true
8890
run_artifact: false
89-
secrets: inherit
9091
final-check:
9192
runs-on: ubuntu-latest
9293
if: ${{ always() }}
9394
needs: [pre-merge]
9495
steps:
9596
- name: Final Status Check
97+
env:
98+
PRE_MERGE_PIPELINE_RESULT: ${{ needs.pre-merge.result }}
9699
run: |
97-
pre_merge_pipeline_result="${{ needs.pre-merge.result }}"
98-
99-
echo "Pre-merge pipeline result: $pre_merge_pipeline_result"
100+
echo "Pre-merge pipeline result: $PRE_MERGE_PIPELINE_RESULT"
100101
101-
if [ "$pre_merge_pipeline_result" == "success" ] || [ "$pre_merge_pipeline_result" == "skipped" ]; then
102+
if [ "$PRE_MERGE_PIPELINE_RESULT" == "success" ] || [ "$PRE_MERGE_PIPELINE_RESULT" == "skipped" ]; then
102103
echo "Pre-merge check passed successfully."
103104
else
104105
echo "Pre-merge checks failed. PR can't get merged"

0 commit comments

Comments
 (0)