Skip to content

Commit 1dc1857

Browse files
committed
ci: Add optional name parameter to the run composite action
1 parent b49219f commit 1dc1857

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/actions/docker-run/action.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ inputs:
1818
tag:
1919
description: "Tag of the built image to use"
2020
required: true
21+
name:
22+
description: "Name for docker to use when running the command"
23+
default: ""
2124
command:
2225
description: "Command to execute inside of the docker container"
2326
required: true
@@ -45,11 +48,13 @@ runs:
4548
- id: dockerrun
4649
name: "Run command ${{ inputs.command }} in ${{ inputs.tag }} docker container"
4750
shell: bash
51+
env:
52+
NAME: ${{ input.name }}
4853
run: |
4954
docker run \
5055
--init -t --rm \
5156
${{ inputs.args }} \
52-
--name "ci-${{ inputs.name }}-${{ inputs.uid }}" \
57+
--name "ci-${NAME:-${{ inputs.tag }}}-${{ inputs.uid }}" \
5358
--env-file=docker/coverage.env \
5459
${{ steps.processenv.outputs.env }} \
5560
"${{ inputs.tag }}_${{ inputs.uid }}" \

0 commit comments

Comments
 (0)