Merge pull request #15993 from crazy-max/ci-fix-fetch-depth

jekyll: fix fetch depth for last_modification_date on deploy
This commit is contained in:
David Karlsson 2022-10-27 08:30:28 +02:00 committed by GitHub
commit 8b7cc61d7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -68,6 +68,8 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

View File

@ -40,6 +40,8 @@ module Jekyll
def pre_read(site)
beginning_time = Time.now
puts "Starting plugin fetch_remote.rb..."
fetch_depth = get_docs_url == "http://localhost:4000" ? 1 : 0
site.config['fetch-remote'].each do |entry|
puts " Repo #{entry['repo']}"
@ -55,11 +57,11 @@ module Jekyll
rescue => e
FileUtils.rm_rf(clonedir)
puts " Cloning repository into #{clonedir}"
git = Git.clone("#{entry['repo']}.git", Pathname.new(clonedir), branch: entry['ref'], depth: 1)
git = Git.clone("#{entry['repo']}.git", Pathname.new(clonedir), branch: entry['ref'], depth: fetch_depth)
end
else
puts " Cloning repository into #{clonedir}"
git = Git.clone("#{entry['repo']}.git", Pathname.new(clonedir), branch: entry['ref'], depth: 1)
git = Git.clone("#{entry['repo']}.git", Pathname.new(clonedir), branch: entry['ref'], depth: fetch_depth)
end
entry['paths'].each do |path|