Checking if a particular file has changed from last commit on master

I want to check if a VERSION file has changed when I run my CI job.

If the VERSION file hasn’t changed the job should fail.

I was thinking I could use the path filtering but I’m unsure how to then fail the job if the VERSION file hasn’t changed.

path-filtering: circleci/path-filtering@0.0.2

version: 2
- path-filtering/filter:
base-revision: master
mapping: |
VERSION modified_version true

Has anyone come across this usecase before? Or have any advice?

Hello, Nick!
Can you please describe your use case in more detail?
As I understand, you need to fail your pipeline every time the VERSION file has no changes?

You could do it with a small bash script that checks the last time the VERSION files was updated. Not ideal, but it would be a workaround.

How you do that depends on what VCS you use…