Error: "cut: -: bad delimiter" during "Validating input and generating pi-gen config" step
Describe the bug
When using the action version v1.10.0, the build fails during the "Validating input and generating pi-gen config" step with the error:
cut: -: bad delimiter
To Reproduce
Using the following workflow configuration:
- name: Build image with pi-gen
uses: usimd/[email protected]
with:
image-name: sumidas-os
stage-list: ${{ github.event.inputs.stage_list || 'stage0 stage1' }}
verbose-output: true
enable-noobs: false
increase-runner-disk-size: true
compression: none
Root Cause
The issue appears to be in src/pi-gen-config.ts around line 117 where the cut command is used:
const cutCmd = await io.which('cut', true)
const supportedLocales = (
await exec.getExecOutput(
cutCmd,
['-d', ' ', '-f1', '/usr/share/i18n/SUPPORTED'],
{silent: true}
)
).stdout.split('\n')
The problem is that the delimiter -d ' ' (a space character) is being interpreted incorrectly in some environments, causing the "bad delimiter" error.
Environment
- Runner OS: Linux (GitHub Actions runner)
- Action version: v1.10.0
Expected behavior
The action should successfully validate the configuration and continue with the build process.
Possible Solution
The cut command might need to be called differently, perhaps:
- Using a different quoting mechanism for the space delimiter
- Using an alternative approach to parse the SUPPORTED file
- Using a different delimiter character if the file format allows
Workaround
Currently looking for a workaround. The issue prevents the action from proceeding past the validation stage.
Could convert that function to pure JavaScript and not need to shell out.
Could switch to depending on s.th. like locale-code.