ukaea/PROCESS

[BUG] CI tracking step will fail if commit message contains `'`

Opened this issue · 0 comments

Describe the bug

If a commit has an apostrophe in the commit message the tracking script will have the remainder of the commit message passed to it as an extra argument. This is because the script is run from bash and bash needs strings escaped see link for a full list: https://unix.stackexchange.com/questions/270977/what-characters-are-required-to-be-escaped-in-command-line-arguments

Steps to reproduce

Add an apostrophe to you're commit message and the tracking step of the CI will fail

Expected behaviour

tracking step not fail on an extra apostrophe

Evidence

See https://github.com/ukaea/PROCESS/actions/runs/9386752431/job/25848590287

Environment

  • OS:
  • Version:

Additional context

This line in the CI yaml and the rest of that step will fail unless the commit message is escaped :

python tracking/tracking_data.py track process-tracking-data --mfile tracking/large_tokamak_MFILE.DAT --hash ${{ github.sha }} --commit '${{ github.event.head_commit.message }}'

possible solutions:
https://stackoverflow.com/questions/2854655/command-to-escape-a-string-in-bash