Skip to content

Commit 9fd6f61

Browse files
committed
Try --no-tag-prefix option
1 parent d6b1efa commit 9fd6f61

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ runs:
1515
using: docker
1616
image: Dockerfile
1717
args:
18-
- --changelog=${{ inputs.changelog }} --tag-prefix='${{ inputs.tag_prefix }}'
18+
- | --changelog ${{ inputs.changelog }} ${{ inputs.tag_prefix ? "--tag-prefix " + inputs.tag_prefix : "--no-tag-prefix" }}
1919
env:
2020
GITHUB_TOKEN: ${{ inputs.github_token }}

changerelease/cli.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@ def cli():
1919
"--changelog",
2020
default="CHANGELOG.md",
2121
type=click.Path(exists=True, file_okay=True, dir_okay=False),
22+
show_default=True,
2223
)
23-
@click.option("--tag-prefix", default="v")
24-
@click.option("--repo", default=lambda: os.environ.get("GITHUB_REPOSITORY", ""))
24+
@click.option("--tag-prefix", default="v", show_default=True)
25+
@click.option("--no-tag-prefix", default=False, is_flag=True)
26+
@click.option("--repo", envvar="GITHUB_REPOSITORY", required=True)
2527
@click.option(
2628
"--api-url",
27-
default=lambda: os.environ.get("GITHUB_API_URL", "https://api.github.com"),
29+
envvar="GITHUB_API_URL",
30+
default="https://api.github.com",
2831
)
29-
@click.option("--token", default=lambda: os.environ.get("GITHUB_TOKEN", ""))
30-
def sync(changelog, tag_prefix, repo, api_url, token):
32+
@click.option("--token", envvar="GITHUB_TOKEN", required=True)
33+
def sync(changelog, tag_prefix, no_tag_prefix, repo, api_url, token):
34+
if no_tag_prefix:
35+
tag_prefix = ""
36+
3137
requests_session = APISession(base_url=api_url)
3238
requests_session.headers.update(
3339
{

0 commit comments

Comments
 (0)