git - Github Action doesn't checkout submodule of action repository - Stack Overflow

On Github actions, submodules of the action repository aren't checkout out, instead only an empty

On Github actions, submodules of the action repository aren't checkout out, instead only an empty folder remains and it's impossible to load the submodules manually, because github action deletes/doesn't create the .git folder (so it only checks out the files and not the repo). How can I fix that:

File Setup:

main repo:
|   action.yml
\--- submodule

submodule repo:
|   test.txt

main_repo/action.yml:

name: "Submodule Test"
description: ""

runs:
  using: "composite"
  steps:
    - name: execute test
      shell: cmd
      run: |
        tree /F /A ${{ github.action_path }}

.../.github/workflows/test.yml

name: Submodule Test
on:
  workflow_dispatch

jobs:
  Pyinstaller:
    runs-on: windows-latest  # same problem on ubuntu-latest
    steps:
      - name: execute pyinstaller_action
        uses: "JohannesK71083/actions_submodule_main@main"

Github actions output:

D:\A\_ACTIONS\JOHANNESK71083\ACTIONS_SUBMODULE_MAIN\MAIN
|   .gitmodules
|   action.yml
|   
\---submodule

Links to the repos:
main repo
submodule repo
action run logs

Edit 1:
I tried publishing it to Github Marketplace to see if that would fit it, but it didn't. (After that I deleted it again from the marketplace.)

On Github actions, submodules of the action repository aren't checkout out, instead only an empty folder remains and it's impossible to load the submodules manually, because github action deletes/doesn't create the .git folder (so it only checks out the files and not the repo). How can I fix that:

File Setup:

main repo:
|   action.yml
\--- submodule

submodule repo:
|   test.txt

main_repo/action.yml:

name: "Submodule Test"
description: ""

runs:
  using: "composite"
  steps:
    - name: execute test
      shell: cmd
      run: |
        tree /F /A ${{ github.action_path }}

.../.github/workflows/test.yml

name: Submodule Test
on:
  workflow_dispatch

jobs:
  Pyinstaller:
    runs-on: windows-latest  # same problem on ubuntu-latest
    steps:
      - name: execute pyinstaller_action
        uses: "JohannesK71083/actions_submodule_main@main"

Github actions output:

D:\A\_ACTIONS\JOHANNESK71083\ACTIONS_SUBMODULE_MAIN\MAIN
|   .gitmodules
|   action.yml
|   
\---submodule

Links to the repos:
main repo
submodule repo
action run logs

Edit 1:
I tried publishing it to Github Marketplace to see if that would fit it, but it didn't. (After that I deleted it again from the marketplace.)

Share Improve this question edited Mar 24 at 12:55 JohannesK71083 asked Mar 23 at 21:28 JohannesK71083JohannesK71083 414 bronze badges
Add a comment  | 

1 Answer 1

Reset to default -3

you need to refer this action in the market place for checking out code base.

https://github/actions/checkout

by default , submodules are not checked out. you need to explicitly pass submodules as true.

- uses: actions/checkout@v4
  with:
     submodules: true

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744268734a4565993.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信