Skip to content
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 repo. fetch/checkout in PR slow CI job #30537

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Fix repo. fetch/checkout in PR slow CI job #30537

merged 1 commit into from
Apr 29, 2024

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Apr 29, 2024

What does this PR do?

Fix repo. fetch/checkout in PR slow CI job.

The previous way:

git fetch && git checkout ${{ github.event.pull_request.head.sha }}

only works for a pull request that is pushed to a branch of huggingface/transformers.

For PRs from outside contributors (so push to a forked repository), it will fail.

The new way

git fetch origin pull/${{ github.event.pull_request.number }}/head:pull/${{ github.event.pull_request.number }}/merge && git checkout pull/${{ github.event.pull_request.number }}/merge

works in both cases.

@ydshieh ydshieh marked this pull request as ready for review April 29, 2024 11:26
@ydshieh ydshieh requested a review from amyeroberts April 29, 2024 11:34
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks!

@ydshieh ydshieh merged commit 87be06c into main Apr 29, 2024
8 of 9 checks passed
@ydshieh ydshieh deleted the fix_fetch_pr branch April 29, 2024 12:32
itazap pushed a commit that referenced this pull request May 14, 2024
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