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

Handle tags created through GitHub in publish release workflow #451

Merged
merged 2 commits into from
May 19, 2022
Merged

Handle tags created through GitHub in publish release workflow #451

merged 2 commits into from
May 19, 2022

Conversation

nawatts
Copy link
Contributor

@nawatts nawatts commented May 19, 2022

Currently, the GitHub Actions workflow for publishing a release assumes that the version is tag is created locally and pushed to GitHub. It automatically creates a corresponding GitHub Release with automatically generated release notes.

/~https://github.com/broadinstitute/gnomad_methods/blob/00365eb7b11ae1f93ad865f1c56917b04c19006f/CONTRIBUTING.md#publishing-a-release

- name: Create release notes
uses: actions/github-script@v5
with:
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});

However, it's also possible to create a tag through GitHub by manually creating a GitHub Release.

In that case, the last step of the release workflow fails because a release already exists for the tag. This happened for the 0.6.2 release and caused confusion because, while everything ended in the desired state (version tagged, code published to PyPI, and release notes in a GitHub Release), the publish release workflow showed as failed.

This changes the publish release workflow to handled the case where a tag is created through GitHub by first checking if a GitHub Release already exists for the version tag before attempting to create one.

Copy link
Contributor

@ch-kr ch-kr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small (optional) suggestion, but LGTM. thank you for adding this!!

CONTRIBUTING.md Outdated Show resolved Hide resolved
Co-authored-by: Katherine Chao <kchao@broadinstitute.org>
@ch-kr ch-kr merged commit be4be1e into broadinstitute:main May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants