mirror of https://github.com/docker/docs.git
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:
commit
8b7cc61d7b
|
@ -68,6 +68,8 @@ jobs:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
|
@ -40,6 +40,8 @@ module Jekyll
|
||||||
def pre_read(site)
|
def pre_read(site)
|
||||||
beginning_time = Time.now
|
beginning_time = Time.now
|
||||||
puts "Starting plugin fetch_remote.rb..."
|
puts "Starting plugin fetch_remote.rb..."
|
||||||
|
|
||||||
|
fetch_depth = get_docs_url == "http://localhost:4000" ? 1 : 0
|
||||||
site.config['fetch-remote'].each do |entry|
|
site.config['fetch-remote'].each do |entry|
|
||||||
puts " Repo #{entry['repo']}"
|
puts " Repo #{entry['repo']}"
|
||||||
|
|
||||||
|
@ -55,11 +57,11 @@ module Jekyll
|
||||||
rescue => e
|
rescue => e
|
||||||
FileUtils.rm_rf(clonedir)
|
FileUtils.rm_rf(clonedir)
|
||||||
puts " Cloning repository into #{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
|
end
|
||||||
else
|
else
|
||||||
puts " Cloning repository into #{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
|
end
|
||||||
|
|
||||||
entry['paths'].each do |path|
|
entry['paths'].each do |path|
|
||||||
|
|
Loading…
Reference in New Issue