chore: fix verify_library_generation.yaml for forks#2716
Conversation
| run: | | ||
| set -ex | ||
| git checkout "${base_ref}" | ||
| git fetch --no-tags --prune origin +${base_ref}:refs/remotes/origin/${base_ref} |
There was a problem hiding this comment.
Why git fetch after git checkout?
There was a problem hiding this comment.
It doesn't actually matter too much for L23-L24, but it's needed for L25/26 so that it can find the forked branches. I can revert this line if preferred.
There was a problem hiding this comment.
If it's not actually useful, I think we should revert it.
There was a problem hiding this comment.
Actually I think we do need it. Added some comments to explain.
| git checkout "${base_ref}" | ||
| git fetch --no-tags --prune origin +${base_ref}:refs/remotes/origin/${base_ref} | ||
| git checkout "${head_ref}" | ||
| git fetch --no-tags --prune origin +${head_ref}:refs/remotes/origin/${head_ref} |
There was a problem hiding this comment.
Should we move this line before git checkout "${head_ref}"?
There was a problem hiding this comment.
Added comments to explain
…into fixVerify_library_generation
…gleapis/sdk-platform-java into fixVerify_library_generation
Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com>
|
|
#2716 didn't quite fix what it should have. Follow up to fix the error: ``` Previous HEAD position was e54601f Merge 30c7c5b into 5d4567f Switched to a new branch 'main' branch 'main' set up to track 'origin/main'. + git fetch --no-tags --prune origin +main:refs/remotes/origin/main From https://github.com/googleapis/sdk-platform-java - [deleted] (none) -> origin/main + git checkout renovate/markupsafe-2.x error: pathspec 'renovate/markupsafe-2.x' did not match any file(s) known to git ``` --------- Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com>
PRs opened by renovate-bot are failing `verify_library_generation` because renovate-bot opens PRs from a fork rather than main. For instance #2657 is failing: ``` env: base_ref: main head_ref: renovate/markupsafe-2.x + git checkout main Previous HEAD position was d84e607 Merge 645951c into 766646a[13](https://github.com/googleapis/sdk-platform-java/actions/runs/8914757209/job/24482995077?pr=2657#step:3:13)3d1465dca Switched to a new branch 'main' branch 'main' set up to track 'origin/main'. + git checkout renovate/markupsafe-2.x error: pathspec 'renovate/markupsafe-2.x' did not match any file(s) known to git ``` This updates the yaml file to explicitly fetch specific branches which should fix the issue. --------- Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com>
#2716 didn't quite fix what it should have. Follow up to fix the error: ``` Previous HEAD position was e54601f Merge 30c7c5b into 5d4567f Switched to a new branch 'main' branch 'main' set up to track 'origin/main'. + git fetch --no-tags --prune origin +main:refs/remotes/origin/main From https://github.com/googleapis/sdk-platform-java - [deleted] (none) -> origin/main + git checkout renovate/markupsafe-2.x error: pathspec 'renovate/markupsafe-2.x' did not match any file(s) known to git ``` --------- Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com>




PRs opened by renovate-bot are failing
verify_library_generationbecause renovate-bot opens PRs from a fork rather than main.For instance #2657 is failing:
This updates the yaml file to explicitly fetch specific branches which should fix the issue.