Optimise fetching all commits in a pull request
See original GitHub issueMy goal is to lint all commit messages in a pull request, or in other words, since branching off the default branch. My workaround is
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
# grab default branch to calculate branch point to know when to stop linting
- if: ${{ github.base_ref }}
run: git branch ${{ github.base_ref }} origin/${{ github.base_ref }}
but for large repos, it would be nice if this action could do the smart thing and only fetch what is needed. Thanks in advance.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5
Top Results From Across the Web
How to Optimize Your Pull Requests for Effective Code Reviews
Prepare a clear commit history ... Thorough use of partial-staging, amending, and rebasing are all tools that will help achieve a clean commit...
Read more >Using git rebase and git merge to optimise your pull requests
open editor with a file that lists all the commits that exist between develop and your branch; you can edit that file and...
Read more >Tips for improving git performance - Cognizant Softvision
Limit the number of commits you have in a branch. · Delete unused branches, also when merging a pull request, make sure you...
Read more >GitHub pull request showing commits that are already in target ...
Here's a good workaround. Use the Edit button when viewing the PR in GitHub to change the base branch to something other than...
Read more >How to Improve Your Pull Request Workflow - Waydev
Get in touch ... Git Pull Requests have been used to review code on branches before it ... Putting a Jira issue key...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
${{ github.event.pull_request.commits }}
is available for that. I guess it was not a year ago.My use case is different but the need is the same: I want to be able to list all files changed in the PR (and decide accordingly if a step needs to be run) but it can only work if the
base_ref
is also fetched, which currently, not knowing the number of commits required, can only be done by fetching the whole repository.