Skip to content

Commit ffb7446

Browse files
authored
chore: Add checkout submodules (#17)
Signed-off-by: Roger Barker <roger.barker@swirldslabs.com>
1 parent ed4a986 commit ffb7446

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
checkout-fetch-depth: 0
4141
checkout-ref: main
4242
checkout-token: ${{ secrets.GITHUB_TOKEN }}
43+
checkout-submodules: false
4344
setup-java: true
4445
java-distribution: 'temurin'
4546
java-version: '25'
@@ -126,6 +127,7 @@ jobs:
126127
checkout: true
127128
checkout-fetch-depth: 0
128129
checkout-ref: main
130+
checkout-submodules: false
129131
checkout-token: ${{ secrets.GITHUB_TOKEN }}
130132

131133
- name: Verify Checkout Outputs

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ Common steps for initializing a job for GitHub actions. This composite action co
2727
2828
**Repository Checkout**
2929
30-
| Input | Description | Required | Default |
31-
|----------------------|----------------------------------------------------------|----------|---------|
32-
| checkout | Whether to checkout the repository | No | - |
33-
| checkout-ref | The branch, tag or SHA to checkout | No | - |
34-
| checkout-token | Personal access token (PAT) used to fetch the repository | No | - |
35-
| checkout-fetch-depth | Depth of commit history to fetch | No | 0 |
30+
| Input | Description | Required | Default | Options |
31+
|----------------------|----------------------------------------------------------|----------|---------|----------------------------|
32+
| checkout | Whether to checkout the repository | No | - | `true`/`false` |
33+
| checkout-ref | The branch, tag or SHA to checkout | No | - | any `branch`/`tag`/`SHA` |
34+
| checkout-token | Personal access token (PAT) used to fetch the repository | No | - | `Token` used for checkout |
35+
| checkout-fetch-depth | Depth of commit history to fetch | No | 0 | `0` (full)/`1`/`2`/... |
36+
| checkout-submodules | Whether to fetch submodules | No | false | `true`/`false`/`recursive` |
3637

3738
**Java**
3839

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ inputs:
1616
description: 'Depth of commit history to fetch'
1717
required: false
1818
default: '0'
19+
checkout-submodules:
20+
description: 'Whether to checkout submodules (true/false/recursive)'
21+
default: 'false'
22+
required: false
1923
setup-node:
2024
description: 'Whether to setup Node.js'
2125
required: false
@@ -200,6 +204,7 @@ runs:
200204
echo "::group::Checkout Code Parameters"
201205
echo "Ref: ${{ inputs.checkout-ref }}"
202206
echo "Fetch Depth: ${{ inputs.checkout-fetch-depth }}"
207+
echo "Submodules: ${{ inputs.checkout-submodules }}"
203208
echo "::endgroup::"
204209
205210
- name: Checkout Code
@@ -208,6 +213,7 @@ runs:
208213
if: ${{ inputs.checkout == 'true' }}
209214
with:
210215
fetch-depth: ${{ inputs.checkout-fetch-depth }}
216+
submodules: ${{ inputs.checkout-submodules }}
211217
ref: ${{ inputs.checkout-ref }}
212218
token: ${{ inputs.checkout-token }}
213219

0 commit comments

Comments
 (0)