Using a variable inside a COMMIT_MSG rule

Hi

I am able to trigger my pipeline from a hardcoded commit message e.g:

rules:
- if: ‘$CI_COMMIT_MESSAGE =~ /some commit message/’

however I want to use a project level variable (settings>CI>Variable) as the commit message e.g

rules:
- if: ‘$CI_COMMIT_MESSAGE =~ /$project_id/’

this doesn’t kick off the pipeline despite the commit message on the file matching the variable. Nor does:

rules:
- if: ‘$CI_COMMIT_MESSAGE =~ /{project_id}/’

Is this even doable?