Skip to content

Commit

Permalink
Add non_image_commands to action
Browse files Browse the repository at this point in the history
  • Loading branch information
dbieber committed Dec 4, 2024
1 parent 5864a94 commit bd4819c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ deleted on cleanup.

### Inputs

#### `non_image_commands`

Commands to execute outside the image after the repo has been copied/mounted into the image, but before the image commands run. Optional.

#### `commands`

Commands to execute. Written to a script within the image. Required.
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ inputs:
description: 'Path to cpu info file to be mounted on /proc/cpuinfo'
required: false
default: ''
non_image_commands:
description: 'Commands to run outside the image, executed with /bin/sh'
required: false
commands:
description: 'Commands to run in the image, executed with /bin/sh'
required: true
Expand Down Expand Up @@ -219,6 +222,9 @@ runs:
sudo cp -Rp ${{ github.workspace }} ${{ steps.mount_image.outputs.mount }}${repository_path}
;;
esac
if [ "${{ inputs.non_image_commands }}x" != "x" ]; then
${{ inputs.non_image_commands }}
fi
if [ "${{ inputs.use_systemd_nspawn }}x" != "x" -a "${{ inputs.use_systemd_nspawn }}x" != "nox" ]; then
chroot_script_dir=/scripts
script_dir=${RUNNER_TEMP:-/home/actions/temp}/scripts
Expand Down

0 comments on commit bd4819c

Please sign in to comment.