-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Include common example for fetching PR base-ref #213
base: master
Are you sure you want to change the base?
Conversation
Since this seems to be a common scenario and is generating a lot of discussion (actions#93), it seems worthwhile to add it to the readme as an example. I placed it before the other fetch examples because this use-case still only fetches minimal history (only adding one additional ref); so it seems helpful to place this above the other fetch examples which all do deeper fetches.
I haven't verified the table-of-contents link (I typed it by hand) |
```yml | ||
- uses: actions/checkout@v2 | ||
- name: Fetch base_ref HEAD | ||
run: git fetch --depth=1 origin +refs/heads/${{github.base_ref}}:refs/remotes/origin/${{github.base_ref}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could actually be simplified to
git fetch --depth=1 origin +${{github.base_ref}}
or
git fetch --depth=1 origin +refs/heads/${{github.base_ref}}
since the destination is the conventional remote ref. But I'm unsure if there are any edge cases with that shortened form that users would encounter... (Then again, since this is supposed to be for "common scenarios", perhaps the short form is better?)
@jasonkarns thanks will look over this soon! |
Uses example in as of yet unmerged PR actions/checkout#213
When running LHCI in GH Actions due to how checkout action clones the repo with a fetch depth of 1 by default the base branch might be missing so LH will not be able to find it during health check. Changing the action settings and fetching the base using a new step will fix this problem for almost all cases where the repo is big enough. This has been discussed here actions/checkout#93 and here actions/checkout#213
Uses example in as of yet unmerged PR actions/checkout#213
Since this seems to be a common scenario and is generating a lot of discussion (#93), it seems worthwhile to add it to the readme as an example.
I placed it before the other fetch examples because this use-case still only fetches minimal history (only adding one additional ref); so it seems helpful to place this above the other fetch examples which all do deeper fetches.