如何在 GitHub 页面上启用 git 子模块

问题描述 投票:0回答:1

我有一个 Astro 网站,它使用 git 子模块 作为其中一个内容集合(只是一堆降价)。当网站在 GitHub 上构建时,Astro 错误告诉我找不到内容集合。构建日志表明子模块已禁用:

Run actions/checkout@v3
  with:
    repository: LiquidZulu/liquidzulu.github.io
    ...
    submodules: false
    ...

关于在 GitHub 页面中使用 git 子模块的文档页面表示子模块必须是公共的并且使用“

https://
只读 URL”。子模块是公共的,这让我想到了第二个标准:
https://
只读 URL 到底是什么?我两种都试过了:

[submodule "src/content/brain"]
    path = src/content/brain
    url = https://github.com/LiquidZulu/brain.git

[submodule "src/content/brain"]
    path = src/content/brain
    url = https://github.com/LiquidZulu/brain

.gitmodules
中,两者都不起作用,而且我没有办法尝试不同的 URL。

git github github-actions github-pages
1个回答
0
投票

解决方案是在

deploy.yml
中添加以下内容:

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - name: Checkout your repository using git
              uses: actions/checkout@v3
              with:
                  submodules: 'true'
© www.soinside.com 2019 - 2024. All rights reserved.