[GitHub Actions] Triggering workflow jobs conditionally based on the file extensions in the PR

I have a workflow called Linting, which runs the linters (ESLint, Stylelint, markdownlint, etc.) when a new Pull Request has been created and marked as ready for the review (when it is no longer marked as a Draft).

Is there a way to trigger a specific job in the workflow based on file extensions in the Pull Request?

For example:

  • if the Pull Request doesn’t have any new/edited markdown files *.md, I would like the job that executes the markdownlint to be skipped.
  • similarly, if there are no new/changed style files (*.css), skip running the job that executes the stylelint.

Is this achievable?