Testings with repo parameter
This commit is contained in:
16
action.yml
16
action.yml
@ -4,6 +4,9 @@ inputs:
|
|||||||
submodule:
|
submodule:
|
||||||
description: Path to submodule (relative from repo root)
|
description: Path to submodule (relative from repo root)
|
||||||
required: true
|
required: true
|
||||||
|
repo:
|
||||||
|
description: Path to the repo
|
||||||
|
required: false
|
||||||
outputs: {}
|
outputs: {}
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
@ -13,14 +16,15 @@ runs:
|
|||||||
uses: 0xFEEDC0DE64/get_submodule_hash@main
|
uses: 0xFEEDC0DE64/get_submodule_hash@main
|
||||||
with:
|
with:
|
||||||
submodule: ${{ inputs.submodule }}
|
submodule: ${{ inputs.submodule }}
|
||||||
|
repo: ${{ inputs.repo }}
|
||||||
|
|
||||||
- name: Cache submodule ${{ inputs.submodule }}
|
- name: Cache submodule ${{ inputs.submodule }}
|
||||||
id: cache-submodule
|
id: cache-submodule
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
.git/modules/${{ inputs.submodule }}
|
./${{ inputs.repo }}/.git/modules/${{ inputs.submodule }}
|
||||||
${{ inputs.submodule }}
|
./${{ inputs.repo }}/${{ inputs.submodule }}
|
||||||
key: ${{ runner.os }}-${{ steps.get-submodule-hash.outputs.hash }}
|
key: ${{ runner.os }}-${{ steps.get-submodule-hash.outputs.hash }}
|
||||||
|
|
||||||
- name: Checkout submodule ${{ inputs.submodule }}
|
- name: Checkout submodule ${{ inputs.submodule }}
|
||||||
@ -32,6 +36,12 @@ runs:
|
|||||||
then
|
then
|
||||||
echo "Cache hit - skipping submodule update"
|
echo "Cache hit - skipping submodule update"
|
||||||
else
|
else
|
||||||
git submodule update --init --recursive ${{ inputs.submodule }}
|
REPO_ARGS=
|
||||||
|
if [[ ! -z "${{ inputs.repo }}" ]]
|
||||||
|
then
|
||||||
|
REPO_ARGS=(-C "${{ inputs.repo }}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
git "${REPO_ARGS[@]}" submodule update --init --recursive ${{ inputs.submodule }}
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
Reference in New Issue
Block a user