Skip to content

add workflow#351

Open
hganwani-droid wants to merge 3 commits intomainfrom
hganwani/gateway-1780-workflow-to-trigger-updation-job-on-pr-merge
Open

add workflow#351
hganwani-droid wants to merge 3 commits intomainfrom
hganwani/gateway-1780-workflow-to-trigger-updation-job-on-pr-merge

Conversation

@hganwani-droid
Copy link
Collaborator

@hganwani-droid hganwani-droid commented Mar 18, 2026

Note

Medium Risk
Adds a new CI workflow that triggers an external TrueFoundry job using repository secrets; main risk is unintended job runs/costs or failures due to secret/config issues.

Overview
Adds a new GitHub Actions workflow (.github/workflows/trigger-updation-job.yml) that runs on pushes to main affecting providers/**.

The job detects changes to providers/**/*.yaml (excluding default.yaml) and, if any, sets up Python, installs the truefoundry CLI, logs in using TFY_API_KEY/TFY_HOST, and triggers a TrueFoundry job via TFY_JOB_FQN.

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

echo "Triggering job for provider=$provider model=$model"
tfy job trigger \
--fqn tfy-usea1-ctl-devtest:models-pricing-data:models-agent-job \
--command "python job.py --provider $provider --model $model"
Copy link
Collaborator

@LordGameleo LordGameleo Mar 18, 2026

Choose a reason for hiding this comment

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

don't do this, it should be model and provider agnostic

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.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

- name: Detect changed model YAML files
id: changes
run: |
changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} -- 'providers/**/*.yaml' | grep -v '/default\.yaml' || true)
Copy link

Choose a reason for hiding this comment

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

Force push causes silent skip of legitimate changes

Medium Severity

On a force push to main, github.event.before references a commit that may no longer exist in the repository (it was rewritten). Even with fetch-depth: 0, unreachable commits aren't fetched, so git diff fails. The || true swallows the error, making $changed empty, and the workflow silently skips — meaning legitimate provider changes won't trigger the updation job at all.

Fix in Cursor Fix in Web

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pushing to main requires a pr

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.

2 participants