1

Working on a python package (in github), where the version is kept in the file:

<package>/__init__.py

like this:

__version__ = "1.0.3"

How to automatically disallow pull request to master if this file has no changes?

arun
  • 10,685
  • 6
  • 59
  • 81

1 Answers1

0

You have the notion of checks for a GitHub Pull Request

That includes a build report, with an automatic build which could, as part of this build, check if the version has changed or not (compared to the target branch).
If not, the build can stop right there in failure.

An alternative approach would be to force the update of that version with a tool like semantic-release/semantic-release.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thx. The link you have shared for automatic build lists 200+ results, so I am not sure how to go about this. Can you pls point me to a resource where this is explained in more detail? – arun Aug 29 '19 at 20:57
  • @arun https://github.com/marketplace/category/continuous-integration is just a way to host a build associated with a PR, as with for instance Travis-CI -https://docs.travis-ci.com/user/pull-requests/). The actual check would be done by the build script: a diff between fork and the target upstream repository (as in https://stackoverflow.com/a/3793113/6309), but limited to one file. – VonC Aug 30 '19 at 06:45