mirror of
https://code.forgejo.org/actions/cache.git
synced 2026-08-10 05:21:12 +00:00
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.
This commit is contained in:
parent
f4c470a8aa
commit
51d4504259
1 changed files with 6 additions and 5 deletions
|
|
@ -18,8 +18,9 @@ inputs:
|
|||
required: false
|
||||
default: ''
|
||||
gcs-bucket:
|
||||
description: 'GCS bucket holding the cached working trees.'
|
||||
required: true
|
||||
description: 'GCS bucket holding the cached working trees. When empty, cache is bypassed and this step is a plain actions/checkout.'
|
||||
required: false
|
||||
default: 'cula-warpbuild-ci-cache-ew1'
|
||||
gcs-path-prefix:
|
||||
description: 'Path prefix inside the bucket.'
|
||||
required: false
|
||||
|
|
@ -33,7 +34,7 @@ runs:
|
|||
steps:
|
||||
- name: Restore working tree from GCS
|
||||
id: restore
|
||||
if: inputs.sparse-checkout == ''
|
||||
if: inputs.sparse-checkout == '' && inputs.gcs-bucket != ''
|
||||
uses: Cula-Technologies/cache/restore@v1
|
||||
with:
|
||||
path: .
|
||||
|
|
@ -51,7 +52,7 @@ runs:
|
|||
ref: ${{ inputs.ref }}
|
||||
|
||||
- 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
|
||||
run: |
|
||||
# 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
|
||||
|
||||
- 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
|
||||
with:
|
||||
path: .
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue