Skip to content

Instantly share code, notes, and snippets.

@abitrolly
Created January 8, 2019 10:05
Show Gist options
  • Save abitrolly/90a9e2b70f57e91ca701a3426f184a71 to your computer and use it in GitHub Desktop.
Save abitrolly/90a9e2b70f57e91ca701a3426f184a71 to your computer and use it in GitHub Desktop.
Autolink for `towncrier` file from PR message
#!/usr/bin/python3
"""
Given:
- PR_URL: https://github.com/release-monitoring/anitya/pull/556
Extract:
- PR_NUMBER: gex(PR_URL, "\d+$")
- FORK
- ???
- Check: abitrolly/anitya
- BRANCH
- ???
- Check: patch-1
Output:
- https://github.com/{{ FORK }}/new/{{ BRANCH }}?filename=news/{{ PR_NUMBER }}
- Check: https://github.com/abitrolly/anitya/new/patch-1?filename=news/556
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment