-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
37 lines (35 loc) · 1.45 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Run Containerized Script
description: |
This action provides a way to run commands on a custom image,
while letting Github handle the setup and teardown of the container, as well as any environment variables and mounts.
Useful when you need to run something on a custom image, but do not wish to run the entire workflow with the `container:` directive.
inputs:
image:
description: "The docker image to use. If the image is stored in a private registry, you may need to authenticate before using this action."
required: true
args:
description: "The arguments to pass to the container. Will be passed to the container using `/bin/bash -c`"
required: true
runs:
using: composite
steps:
- name: Prepare image
run: |
echo "::group::Pulling image ${{ inputs.image }} and retagging as 'containerized_runner'"
docker pull ${{ inputs.image }}
docker tag ${{ inputs.image }} containerized_runner
echo "::endgroup::"
shell: bash
- name: Symlink current action repo
env:
action_path: ${{ github.action_path }}
run: ln -fs ${{ env.action_path }} .github/.action_repo.run-containerized-script
shell: bash
- name: Run on container
uses: ./.github/.action_repo.run-containerized-script/run
with:
args: ${{ inputs.args }}
- name: Unlink the action repository
if: always()
run: rm -f .github/.action_repo.run-containerized-script
shell: bash