diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f8f5c8..dccb365 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,6 +40,7 @@ jobs: checkout-fetch-depth: 0 checkout-ref: main checkout-token: ${{ secrets.GITHUB_TOKEN }} + checkout-submodules: false setup-java: true java-distribution: 'temurin' java-version: '25' @@ -126,6 +127,7 @@ jobs: checkout: true checkout-fetch-depth: 0 checkout-ref: main + checkout-submodules: false checkout-token: ${{ secrets.GITHUB_TOKEN }} - name: Verify Checkout Outputs diff --git a/README.md b/README.md index a8f7ad5..10547a4 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,13 @@ Common steps for initializing a job for GitHub actions. This composite action co **Repository Checkout** -| Input | Description | Required | Default | -|----------------------|----------------------------------------------------------|----------|---------| -| checkout | Whether to checkout the repository | No | - | -| checkout-ref | The branch, tag or SHA to checkout | No | - | -| checkout-token | Personal access token (PAT) used to fetch the repository | No | - | -| checkout-fetch-depth | Depth of commit history to fetch | No | 0 | +| Input | Description | Required | Default | Options | +|----------------------|----------------------------------------------------------|----------|---------|----------------------------| +| checkout | Whether to checkout the repository | No | - | `true`/`false` | +| checkout-ref | The branch, tag or SHA to checkout | No | - | any `branch`/`tag`/`SHA` | +| checkout-token | Personal access token (PAT) used to fetch the repository | No | - | `Token` used for checkout | +| checkout-fetch-depth | Depth of commit history to fetch | No | 0 | `0` (full)/`1`/`2`/... | +| checkout-submodules | Whether to fetch submodules | No | false | `true`/`false`/`recursive` | **Java** diff --git a/action.yml b/action.yml index 60e1fb1..ebb7dae 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,10 @@ inputs: description: 'Depth of commit history to fetch' required: false default: '0' + checkout-submodules: + description: 'Whether to checkout submodules (true/false/recursive)' + default: 'false' + required: false setup-node: description: 'Whether to setup Node.js' required: false @@ -200,6 +204,7 @@ runs: echo "::group::Checkout Code Parameters" echo "Ref: ${{ inputs.checkout-ref }}" echo "Fetch Depth: ${{ inputs.checkout-fetch-depth }}" + echo "Submodules: ${{ inputs.checkout-submodules }}" echo "::endgroup::" - name: Checkout Code @@ -208,6 +213,7 @@ runs: if: ${{ inputs.checkout == 'true' }} with: fetch-depth: ${{ inputs.checkout-fetch-depth }} + submodules: ${{ inputs.checkout-submodules }} ref: ${{ inputs.checkout-ref }} token: ${{ inputs.checkout-token }}