Fix translation workflow environment and remove timestamp fallback#850
Merged
Conversation
- Add GITHUB_TOKEN and GITHUB_REPOSITORY env vars to sync and dry-run steps so the translate job can properly find the translation baseline - Fix ci-pr to check if docs/ has staged changes after git add, rather than checking for any untracked files in the repo (which incorrectly detected the artifacts/ directory as changes)
Fail fast with clear error when GITHUB_TOKEN is unavailable, rather than silently falling back to timestamp comparison which produces unreliable results (especially for prompt-change detection). Users can use --since to specify a baseline commit manually if needed.
✅ Deploy Preview for nextflow-training ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
Nextflow linting complete! ❌ 1 files had 1 errors 💡 Tip: Click filename locations to go directly to that code. View all 1 issues
View formatting changes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GITHUB_TOKENandGITHUB_REPOSITORYto translate job sosynccan find the baselineci-prto check for actual staged changes indocs/rather than any untracked filesProblem
synccommand was missingGITHUB_TOKEN, causing it to fall back to timestamp comparison which doesn't work for prompt-change detection (and is unreliable in general)ci-prcommand detectedartifacts/directory as untracked files and tried to commit when there were no actual translation changesChanges
Workflow (
translate.yml):GITHUB_TOKENandGITHUB_REPOSITORYenv vars to both sync and dry-run stepsScript (
translate.py):ci-prto checkgit diff --cached --quietafter staging, notrepo.is_dirty()get_file_commit_time()function (no longer needed)get_outdated_files()- returns empty list if no baselinesyncto fail with clear error when baseline unavailable, with hint to use--sinceFixes issues seen in https://github.com/nextflow-io/training/actions/runs/21768935909