|
40 | 40 | description: 'Number of commits to fetch, defaults to 1 similar to actions/checkout' |
41 | 41 | default: 1 |
42 | 42 | type: number |
| 43 | + single-branch: |
| 44 | + description: 'Whether to fetch only a single branch, defaults to true' |
| 45 | + default: true |
| 46 | + type: boolean |
| 47 | + checkout-mode: |
| 48 | + description: 'Mode of checkout; one of "normal", "blobless", "treeless".' |
| 49 | + default: "normal" |
| 50 | + type: string |
43 | 51 | submodules: |
44 | 52 | description: |
45 | 53 | Same as actions/checkout, set to `true` to checkout submodules or `recursive` to |
@@ -124,6 +132,7 @@ jobs: |
124 | 132 | # Will be blank outside of this |
125 | 133 | PR_NUMBER: ${{ github.event.pull_request.number }} |
126 | 134 | SCRIPT: ${{ inputs.script }} |
| 135 | + filter: ${{ inputs.checkout-mode == 'blobless' && 'blob:none' || inputs.checkout-mode == 'treeless' && 'tree:0' || null }} |
127 | 136 | runs-on: ${{ inputs.runner }} |
128 | 137 | # TODO: Eventually this should run in a container, we need to make a container that matches up |
129 | 138 | # with the users for our self hosted runner infra since using actions/checkout with a root |
@@ -177,14 +186,17 @@ jobs: |
177 | 186 | docker exec -it $(docker container ps --format '{{.ID}}') bash |
178 | 187 |
|
179 | 188 | - name: Checkout repository (${{ inputs.repository || github.repository }}@${{ inputs.ref }}) |
180 | | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 189 | + uses: ./.github/actions/checkout |
181 | 190 | with: |
182 | 191 | # Support the use case where we need to checkout someone's fork |
183 | 192 | repository: ${{ inputs.repository || github.repository }} |
184 | 193 | ref: ${{ inputs.ref || github.ref }} |
| 194 | + single-branch: ${{ inputs.single-branch }} |
185 | 195 | path: ${{ inputs.repository || github.repository }} |
186 | 196 | fetch-depth: ${{ inputs.fetch-depth }} |
187 | 197 | submodules: ${{ inputs.submodules }} |
| 198 | + filter: ${{ env.filter }} |
| 199 | + submodules-filter: ${{ env.filter }} |
188 | 200 |
|
189 | 201 | - name: Calculate docker image |
190 | 202 | id: calculate-docker-image |
|
0 commit comments