-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix workflow #40
Fix workflow #40
Conversation
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
src/config.tsOops! Something went wrong! :( ESLint: 9.18.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by WalkthroughThe pull request introduces modifications to the GitHub Actions workflow in Changes
Possibly related PRs
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/weekly-summaries.yml
(2 hunks)src/config.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/config.ts
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/weekly-summaries.yml
[error] 42-42: trailing spaces
(trailing-spaces)
🔇 Additional comments (1)
.github/workflows/weekly-summaries.yml (1)
73-77
: Add error handling for empty historical data.The workflow should handle cases where
historical_merge.json
might be empty, especially during initial runs.Add error checking:
python scripts/merge_contributors.py --days $DAYS_SINCE_START --dir data/daily/history -o data/historical_merge.json + if [ ! -s data/historical_merge.json ]; then + echo "Warning: No historical data found" + exit 0 + fi python scripts/analyze_contributors.py data/historical_merge.json data/analysis.json --after ${DATE_START} --before ${DATE_END} -f python scripts/calculate_scores.py data/historical_merge.json data/historical_merge_scored.json python scripts/merge_contributors_xp.py data/historical_merge_scored.json data/analysis.json data/historical.json
# Calculate days since project start | ||
start_date="2024-10-15" | ||
current_date=$(date +'%Y-%m-%d') | ||
days_since_start=$(( ( $(date -d "$current_date" +%s) - $(date -d "$DATE_START" +%s) ) / 86400 )) | ||
echo "DAYS_SINCE_START=$days_since_start" >> $GITHUB_ENV | ||
|
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.
🛠️ Refactor suggestion
Optimize date calculation block.
- Remove redundant
start_date
variable asDATE_START
is already set. - Fix trailing spaces.
- Ensure consistent timezone handling.
- # Calculate days since project start
- start_date="2024-10-15"
- current_date=$(date +'%Y-%m-%d')
- days_since_start=$(( ( $(date -d "$current_date" +%s) - $(date -d "$DATE_START" +%s) ) / 86400 ))
- echo "DAYS_SINCE_START=$days_since_start" >> $GITHUB_ENV
+ # Calculate days since project start
+ days_since_start=$(TZ=UTC0 $(( ( $(date -d "$(date +'%Y-%m-%d')" +%s) - $(date -d "$DATE_START" +%s) ) / 86400 )))
+ echo "DAYS_SINCE_START=$days_since_start" >> $GITHUB_ENV
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 yamllint (1.35.1)
[error] 42-42: trailing spaces
(trailing-spaces)
Summary by CodeRabbit
Workflow Updates
Configuration Changes