checkout: default gcs-bucket to cula-warpbuild-ci-cache-ew1

Callers can omit gcs-bucket and get the Cula cache bucket; override via
input for other setups. Empty string still opts out of caching entirely.
pull/1786/head
Jasperhino 3 months ago
parent f4c470a8aa
commit 51d4504259

@ -18,8 +18,9 @@ inputs:
required: false required: false
default: '' default: ''
gcs-bucket: gcs-bucket:
description: 'GCS bucket holding the cached working trees.' description: 'GCS bucket holding the cached working trees. When empty, cache is bypassed and this step is a plain actions/checkout.'
required: true required: false
default: 'cula-warpbuild-ci-cache-ew1'
gcs-path-prefix: gcs-path-prefix:
description: 'Path prefix inside the bucket.' description: 'Path prefix inside the bucket.'
required: false required: false
@ -33,7 +34,7 @@ runs:
steps: steps:
- name: Restore working tree from GCS - name: Restore working tree from GCS
id: restore id: restore
if: inputs.sparse-checkout == '' if: inputs.sparse-checkout == '' && inputs.gcs-bucket != ''
uses: Cula-Technologies/cache/restore@v1 uses: Cula-Technologies/cache/restore@v1
with: with:
path: . path: .
@ -51,7 +52,7 @@ runs:
ref: ${{ inputs.ref }} ref: ${{ inputs.ref }}
- name: Strip credentials before caching - name: Strip credentials before caching
if: inputs.sparse-checkout == '' && steps.restore.outputs.cache-hit != 'true' if: inputs.sparse-checkout == '' && inputs.gcs-bucket != '' && steps.restore.outputs.cache-hit != 'true'
shell: bash shell: bash
run: | run: |
# actions/checkout writes a token-bearing extraheader into .git/config; remove it # actions/checkout writes a token-bearing extraheader into .git/config; remove it
@ -59,7 +60,7 @@ runs:
git -C "${GITHUB_WORKSPACE}" config --local --unset-all http.https://github.com/.extraheader || true git -C "${GITHUB_WORKSPACE}" config --local --unset-all http.https://github.com/.extraheader || true
- name: Save working tree to GCS - name: Save working tree to GCS
if: inputs.sparse-checkout == '' && steps.restore.outputs.cache-hit != 'true' if: inputs.sparse-checkout == '' && inputs.gcs-bucket != '' && steps.restore.outputs.cache-hit != 'true'
uses: Cula-Technologies/cache/save@v1 uses: Cula-Technologies/cache/save@v1
with: with:
path: . path: .

Loading…
Cancel
Save