Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tag in GH action config #906

Closed
rantoniuk opened this issue May 1, 2024 · 7 comments · Fixed by #908
Closed

Support tag in GH action config #906

rantoniuk opened this issue May 1, 2024 · 7 comments · Fixed by #908
Assignees
Labels
feature A new feature or a feature request released

Comments

@rantoniuk
Copy link

--commit and --tag are supported separately, i.e. I can run a release on a non-PyPi project that does not require any source code changes and just create a tag and pushing it when doing a release.

This is possible in the tool:
https://python-semantic-release.readthedocs.io/en/latest/commands.html#tag-no-tag

but it's not possible in GH action, as there is only commit option available:
https://github.com/python-semantic-release/python-semantic-release/blob/master/action.yml#L53
and no tag option.

@rantoniuk rantoniuk added the feature A new feature or a feature request label May 1, 2024
@rantoniuk rantoniuk changed the title Add tag in GH action configs Support tag in GH action config May 1, 2024
@codejedi365 codejedi365 self-assigned this May 1, 2024
@codejedi365
Copy link
Contributor

That is a good catch, thank you. I did need to up date it. It is not easy keeping up with the action config as there isn't real testing for it.

@codejedi365
Copy link
Contributor

@rantoniuk , would you try out this fix and see if it works for you?

jobs:
  release:
    runs-on: ubuntu-latest
    concurrency: release
    permissions:
      id-token: write
      contents: write

    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0

    - name: Python Semantic Release
      uses: codejedi365/python-semantic-release@fix/gha-missing-tag-option
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        commit: false
        tag: true
        # ...

@codejedi365 codejedi365 added the awaiting-reply Waiting for response label May 3, 2024
@rantoniuk
Copy link
Author

Thanks for quick reply. Actually I tested it using the current version and it works without that patch as expected, i.e. it creates a tag but does not push any commits.
I left a PR comment as well :)

@codejedi365
Copy link
Contributor

codejedi365 commented May 3, 2024

I left a PR comment as well :)

Thank you!

Actually I tested it using the current version and it works without that patch as expected, i.e. it creates a tag but does not push any commits.

I realize now that really it's because the default is --commit and --tag. If you just turn off commit with commit: false then it is implicitly --tag, but there is no explicit option to toggle the tag flag via the GitHub Action until my PR. So the PR gives the explicit ability to toggle the tag and commit options separately.

codejedi365 added a commit to codejedi365/python-semantic-release that referenced this issue May 3, 2024
codejedi365 added a commit to codejedi365/python-semantic-release that referenced this issue May 4, 2024
codejedi365 added a commit to codejedi365/python-semantic-release that referenced this issue May 5, 2024
@codejedi365 codejedi365 added released and removed awaiting-reply Waiting for response labels May 6, 2024
@codejedi365
Copy link
Contributor

🎉 This issue has been resolved in version 9.7.0 🎉

The release is available on:

@rantoniuk
Copy link
Author

@codejedi365 thanks for swift action!

Quick question, how do you auto-comment the related github issues to add the release information (above)? I looked at your github workflows but I don't see anything related to this and this is a very useful thing!

@codejedi365
Copy link
Contributor

Quick question, how do you auto-comment the related github issues to add the release information (above)?

Manual copy and paste! lol!

I copied the template from the JS version of semantic-release, which auto-posts messages like these for all issues that were resolved, because of how awesome it is. One day, PSR will too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or a feature request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants