Skip to content

Commit

Permalink
Replace slashes in ref with underscores to prevent the creation of ne…
Browse files Browse the repository at this point in the history
…edless subdirs
  • Loading branch information
chippmann committed Oct 9, 2024
1 parent 2e51b7c commit b9b9c81
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ runs:
#
# Cache setup for our own repo
# Stores the cache on a self-hosted S3 instance based on cache name and suffixed by the git ref
# example: editor_debug_linux_x86_64-refs/heads/master
# example: editor_debug_linux_x86_64-refs_heads_master

- name: Prepare GitHub ref
if: ${{ inputs.s3-host != '' }}
id: prepare_ref
uses: actions/github-script@v6
with:
script: |
const ref = process.env.GITHUB_REF.replace(/\//g, '_');
core.exportVariable('PREPARED_REF', ref);
- name: Setup s3 cache
if: ${{ inputs.s3-host != '' }}
uses: philiplehmann/[email protected]
Expand All @@ -36,7 +46,7 @@ runs:
accessKey: ${{inputs.s3-user}} # required
secretKey: ${{inputs.s3-password}} # required
bucket: ${{inputs.s3-bucket}} # required
key: ${{ inputs.key }}-${{github.ref}}
key: ${{ inputs.key }}-${{ env.PREPARED_REF }}
path: ${{ inputs.path }}


Expand Down

0 comments on commit b9b9c81

Please sign in to comment.