This GitHub Action automates the process of generating releases in your GitHub repository. It creates a new release based on the latest version tag, increments the version number following semantic versioning, and includes commit messages in the release notes. You can also add a custom description to the release.
- Automatic Versioning: Increments the patch version automatically following semantic versioning.
- Commit-Based Changelog: Generates release notes based on commit messages since the last release.
- Custom Release Description: Allows for additional custom release notes to be included.
- Fully Dockerized: Runs in a Docker container with a Python environment.
Input Name | Description | Required | Default Value |
---|---|---|---|
github_token |
GitHub token used for authentication with the GitHub API. | Yes | N/A |
add_description |
Additional custom description for the release. | No | N/A |
github_owner |
The GitHub username or organization that owns the repository. | Yes | N/A |
github_repo |
The name of the repository on GitHub where the release will be created. | Yes | N/A |
incremental_type |
The type of version increment to use (major , minor , or patch ). |
No | patch |
This action does not produce any outputs.
Here’s an example of how to use this GitHub Action in a workflow:
name: Release Workflow
env:
INCREMENTAL_TYPE: patch
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate Release
uses: ADORSYS-GIS/release_generator@v1.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
add_description: "This is an additional note for the release."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ secrets.GITHUB_USERNAME }}
REPO_NAME: ${{ secrets.REPO_NAME }}
INCREMENTAL_TYPE: ${{ env.INCREMENTAL_TYPE }}
-
Versioning: The action fetches the latest release or tag from your repository. If no releases or tags are found, it starts from version
0.0.0
and increments to0.0.1
. -
Commit Messages: It gathers all commit messages since the last release/tag and includes them in the release notes.
-
Release Notes: The commit messages are grouped under the "Changes in this release" section. If provided, the content of
add_description
is added as additional notes. -
Release Creation: The action creates a new release on GitHub with the incremented version and the generated release notes.
To test or modify this action locally, you can build and run the Docker container manually:
docker build -t release-generator .
docker run --rm -e GITHUB_TOKEN=your-token -e ADD_DESCRIPTION="This is a test release" -e REPO_NAME=your_repo_name -e GITHUB_USERNAME=your_github_username -e INCREMENT_TYPE=major release-generator
Contributions are welcome! Feel free to open issues or submit pull requests.
- Fork this repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.