Skip to content

Commit 52e1b9f

Browse files
committed
Add v prefix expectation
1 parent 2ec43b6 commit 52e1b9f

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ Nothing yet.
1313

1414
The first release! Includes the `sync` command which will sync your `CHANGELOG.md` to GitHub Release notes.
1515

16-
[Unreleased]: https://github.com/dropseed/sitechecks/compare/0.1.0...HEAD
17-
[0.1.0]: https://github.com/dropseed/sitechecks/releases/tag/0.1.0
16+
[Unreleased]: https://github.com/dropseed/sitechecks/compare/v0.1.0...HEAD
17+
[0.1.0]: https://github.com/dropseed/sitechecks/releases/tag/v0.1.0

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Sync your GitHub Release notes with your `CHANGELOG.md`.
44

55
This tool expects that you follow the [Keep a Changelog](https://keepachangelog.com/) format.
66

7+
Note that, per [SemVer](https://semver.org/spec/v1.0.0.html#tagging-specification-semvertag), this tool also expects that your git tags are prefixed with a "v". As in, "v3.0.0" and not "3.0.0".
8+
79
## Use the GitHub Action
810

911
```yml
@@ -21,4 +23,5 @@ jobs:
2123
steps:
2224
- uses: actions/checkout@v2
2325
- uses: dropseed/changerelease
26+
2427
```

changerelease/release.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def exists(self):
1515

1616
def tag_exists(self):
1717
response = self.requests_session.get(
18-
f"/repos/{self.repo}/git/refs/tags/{self.version}"
18+
f"/repos/{self.repo}/git/refs/tags/v{self.version}"
1919
)
2020
if response.status_code == 404:
2121
return False
@@ -27,7 +27,7 @@ def body_matches(self, contents):
2727

2828
def get(self):
2929
response = self.requests_session.get(
30-
f"/repos/{self.repo}/releases/tags/{self.version}"
30+
f"/repos/{self.repo}/releases/tags/v{self.version}"
3131
)
3232
if response.status_code == 404:
3333
return {}
@@ -38,7 +38,7 @@ def create(self, name, contents):
3838
response = self.requests_session.post(
3939
f"/repos/{self.repo}/releases",
4040
json={
41-
"tag_name": name,
41+
"tag_name": "v" + name,
4242
"name": name,
4343
"body": contents,
4444
# TODO prerelease if semver prerelease

0 commit comments

Comments
 (0)