ci: fetch only the target branch tip trees in check-changelog
The check fetched the whole history of develop with all tags for every pull request (about 250 MB), which was slow and loaded the git server. Listing added files only needs the trees of the tip.
This commit is contained in:
parent
24038667b2
commit
f26a760f86
2 changed files with 3 additions and 1 deletions
0
changelog.d/ci-cheap-changelog-check.skip
Normal file
0
changelog.d/ci-cheap-changelog-check.skip
Normal file
|
|
@ -6,7 +6,9 @@ git config --global --add safe.directory "$(pwd)"
|
|||
echo "looking for change log"
|
||||
|
||||
git remote add upstream https://git.pleroma.social/pleroma/pleroma.git
|
||||
git fetch upstream ${CI_COMMIT_TARGET_BRANCH}:refs/remotes/upstream/${CI_COMMIT_TARGET_BRANCH}
|
||||
# Only the tip's trees are needed to list added files: no history, tags or file contents.
|
||||
git fetch --depth=1 --no-tags --filter=blob:none upstream \
|
||||
${CI_COMMIT_TARGET_BRANCH}:refs/remotes/upstream/${CI_COMMIT_TARGET_BRANCH}
|
||||
|
||||
git diff --raw --no-renames upstream/${CI_COMMIT_TARGET_BRANCH} HEAD -- changelog.d | \
|
||||
grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security\|change\)$'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue