Skip to content

Commit bd55347

Browse files
Fix a bug in jobs w/o sccache setup (#27)
* Only forward sccache variables when they're valid * Use arrays instead of strings * Use github substitution instead of bash
1 parent 62eeed9 commit bd55347

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

internal/docker-run/action.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,21 @@ runs:
8181
if: ${{ !inputs.docker-cache }}
8282
run: time docker pull -q ${{ inputs.image }}
8383

84-
- name: Run docker
84+
- name: Forward sccache arguments
8585
shell: bash
86+
id: sccache
87+
if: ${{ env.SCCACHE_GCS_KEY_PATH != '' }}
8688
run: >
87-
time docker run ${{ inputs.run-flags}} -v${{ github.workspace }}:/workspace
89+
echo "args="
8890
-e SCCACHE_GCS_RW_MODE=$SCCACHE_GCS_RW_MODE
8991
-e SCCACHE_GCS_BUCKET=$SCCACHE_GCS_BUCKET
9092
-e SCCACHE_GCS_KEY_PREFIX=$SCCACHE_GCS_KEY_PREFIX
91-
-e SCCACHE_GCS_KEY_PATH=/workspace/$(basename $SCCACHE_GCS_KEY_PATH || echo "unknown")
93+
-e SCCACHE_GCS_KEY_PATH=/workspace/$(basename $SCCACHE_GCS_KEY_PATH)
94+
"" >> $GITHUB_OUTPUT
95+
96+
- name: Run docker
97+
shell: bash
98+
run: >
99+
time docker run ${{ steps.sccache.outputs.args }}
100+
${{ inputs.run-flags}} -v${{ github.workspace }}:/workspace
92101
${{ inputs.image }} ${{ inputs.command }}

0 commit comments

Comments
 (0)