How to use changeset to skip pipeline stage if only certain files changed

Hi,

We are using Jenkinsfile which has multiple pipeline stages.
In a specific stage, I want to skip the stage when a PR only includes *.md in any folder or .gitignore in any folder or tools/*.cfg that are changed. Any other file changes shall not skip the stage.
How can I achieve this using changeset in assumption I mentioned above?

Thanks in advance!

Use with or, anyOf, like this

when {
    anyOf {
        changeset "**/*.md"
        changeset "**/.gitignore"
        changeset "tools/*.cfg"
    }
}

Hi, Thank you for your reply.
But I think what you suggested is not skipping the stage but instead entering the stage.

You can wrap it all in not {}

No, this does not work:

not {
    anyOf {
        changeset "**/*.md"
        changeset "**/.gitignore"
        changeset "tools/*.cfg"
    }
}

I got Warning, empty changelog. Probably because this is the first build. but the stage is still being executed.