a github action to automatically create a new release when a new version is pushed. It checks the version in a pyproject.toml
file, and if a tag of the version does not exist. It fetches the release notes from a changelog and creates a release for that version.
name: Check for new tags
on:
push:
branches:
- main
jobs:
check-tag:
permissions:
contents: write
name: check for new tags
runs-on: ubuntu-latest
steps:
- name: release on new version
uses: biocatchltd/release-on-new-version@latest
with:
token: ${{ secrets.MY_SECRET_TOKEN }}
token
: a github token to use when releasing, defaults to the defaultgithub.token
, note that the default token does not trigger workflowspyproject-path
: the path to the TOML file to use to determine the version, default topyproject.toml
changelog-path
: the path to the markdown file to use to determine the version, default toCHANGELOG.md
is-released
: whether the step created a new releasefound-version
: the version detected by the actionrelease-notes
: the markdown snippet of the release notes of the version, will be blank if no version was releasedis-prerelease
: whether the version is detected as a pre-release (currently, all versions with a-
in them are considered pre-releases)
This Action requires the following permissions on the GitHub integration token:
permissions:
contents: write