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.)
1 Answer
Reset to default -3you 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条)