Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hack/release/chart-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -ex

# github repo owner: e.g k8snetworkplumbingwg
GITHUB_REPO_OWNER=${GITHUB_REPO_OWNER:-}
GITHUB_REPO_OWNER=$(tr '[:upper:]' '[:lower:]' <<< "${GITHUB_REPO_OWNER:-}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic for initializing and lowercasing GITHUB_REPO_OWNER is duplicated in hack/release/chart-update.sh. Both scripts also share similar logic for handling GITHUB_TOKEN and VERSION environment variables and their validation. To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, consider extracting this common setup into a shared script (e.g., hack/release/common.sh) and sourcing it in both chart-push.sh and chart-update.sh.

# github api token with package:write permissions
GITHUB_TOKEN=${GITHUB_TOKEN:-}
# version: tag (e.g v1.2.3) or SHA (e.g a1b2c3d)
Expand Down
2 changes: 1 addition & 1 deletion hack/release/chart-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ VERSION=${VERSION:-}
# github api token (needed only for read access)
GITHUB_TOKEN=${GITHUB_TOKEN:-}
# github repo owner e.g k8snetworkplumbingwg
GITHUB_REPO_OWNER=${GITHUB_REPO_OWNER:-}
GITHUB_REPO_OWNER=$(tr '[:upper:]' '[:lower:]' <<< "${GITHUB_REPO_OWNER:-}")

BASE=${PWD}
YQ_CMD="${BASE}/bin/yq"
Expand Down
Loading