Repository navigation
chore: clean-up docs, and minor script improvements #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,9 @@ usage() { | |
| echo " version Version in format X.Y.Z (e.g., 7.120.0)" | ||
| echo " --debug Show detailed API call information" | ||
| echo "" | ||
| echo "Example: $0 7.120.0" | ||
| echo "Environment Variables:" | ||
| echo " GITHUB_TOKEN GitHub personal access token or organization bot token" | ||
| echo " Required for API access to check release status" | ||
| exit 1 | ||
| } | ||
|
|
||
|
|
@@ -477,27 +479,35 @@ fi | |
| validate_version "$VERSION" | ||
| BRANCH=$(calculate_branch "$VERSION") | ||
|
|
||
| # Check tokens | ||
| if [[ -z "${CHE_BOT_GITHUB_TOKEN:-}" ]]; then | ||
| echo "[ERROR] CHE_BOT_GITHUB_TOKEN is not set" >&2 | ||
| echo "Set it with: export CHE_BOT_GITHUB_TOKEN=<your-token>" >&2 | ||
| # Check token availability | ||
| check_token=$(get_github_token) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Validate the tokens used for repository requests. If both bot tokens are set, 🤖 Prompt for AI Agents |
||
| if [[ -z "$check_token" ]]; then | ||
| echo "[ERROR] No GitHub token available" >&2 | ||
| echo "Set one of: GITHUB_TOKEN, CHE_BOT_GITHUB_TOKEN, or CHE_INCUBATOR_BOT_GITHUB_TOKEN" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ -z "${CHE_INCUBATOR_BOT_GITHUB_TOKEN:-}" ]]; then | ||
| echo "[WARN] CHE_INCUBATOR_BOT_GITHUB_TOKEN is not set, using CHE_BOT_GITHUB_TOKEN for all repos" >&2 | ||
| export CHE_INCUBATOR_BOT_GITHUB_TOKEN="$CHE_BOT_GITHUB_TOKEN" | ||
| fi | ||
| # Validate token by checking rate limit | ||
| debug_log "Validating GitHub token..." | ||
| remaining=$(check_rate_limit "$check_token") || { | ||
|
Comment on lines
+490
to
+492
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Do not treat the rate-limit check as a repository-permission check. A token can pass 🤖 Prompt for AI Agents |
||
| echo "[ERROR] Failed to authenticate with GitHub API" >&2 | ||
| echo "One of the provided tokens (GITHUB_TOKEN, CHE_BOT_GITHUB_TOKEN, or CHE_INCUBATOR_BOT_GITHUB_TOKEN) may be invalid or expired" >&2 | ||
| exit 1 | ||
|
Comment on lines
+492
to
+495
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Report exhausted rate limits as rate-limit errors. If 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| # Check rate limit | ||
| remaining=$(check_rate_limit "$CHE_BOT_GITHUB_TOKEN") || true | ||
| if [[ "$remaining" == "0" ]]; then | ||
| if [[ "$remaining" == "unknown" ]]; then | ||
| echo "[ERROR] Failed to validate GitHub token" >&2 | ||
| echo "The token may be invalid, expired, or lack required permissions" >&2 | ||
| exit 1 | ||
| elif [[ "$remaining" == "0" ]]; then | ||
| echo "[ERROR] GitHub API rate limit exhausted. Try again later." >&2 | ||
| exit 1 | ||
| elif [[ "$remaining" != "unknown" ]] && [[ "$remaining" -lt 100 ]]; then | ||
| elif [[ "$remaining" -lt 100 ]]; then | ||
| echo "[WARN] GitHub API rate limit low: ${remaining} requests remaining" >&2 | ||
| fi | ||
|
|
||
| debug_log "Token validated successfully. Rate limit remaining: ${remaining}" | ||
|
|
||
| # Parse config | ||
| parse_release_config "$REPO_ROOT/che-release.yaml" | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
Remove
evalfrom the release command.If the
phasesinput contains shell syntax,evalexecutes that syntax instead of passing it tomake-release.sh. This creates a command-execution path in a job that exports GitHub tokens. Pass dispatch inputs through environment variables, build an argument array, and invoke the script with"${args[@]}". Keep inputs out of direct${{ ... }}interpolation in shell source as part of the same fix.🤖 Prompt for AI Agents