https://github.com/simbo/changes-since-last-release-action
A GitHub action to collect all changes to a repository since the last release.
https://github.com/simbo/changes-since-last-release-action
Last synced: 12 months ago
JSON representation
A GitHub action to collect all changes to a repository since the last release.
- Host: GitHub
- URL: https://github.com/simbo/changes-since-last-release-action
- Owner: simbo
- License: mit
- Created: 2020-11-28T00:17:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T09:51:39.000Z (over 2 years ago)
- Last Synced: 2024-11-17T15:53:37.164Z (over 1 year ago)
- Language: Shell
- Size: 7.81 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# "Changes since last Release" Action
[](https://github.com/simbo/changes-since-last-release-action/releases)
[](https://github.com/marketplace/actions/changes-since-last-release)
⚠️ ⚠️ ⚠️
**DEPRECATED IN FAVOR OF [simbo/changes-between-tags-action](https://github.com/simbo/changes-between-tags-action)**
⚠️ ⚠️ ⚠️
A GitHub action to collect all changes to a repository since the last release.
---
- ["Changes since last Release" Action](#changes-since-last-release-action)
- [About](#about)
- [Usage](#usage)
- [Inputs](#inputs)
- [Outputs](#outputs)
- [Simple Example](#simple-example)
- [Example with optional Inputs](#example-with-optional-inputs)
- [Example together with "Create a Release" and "Version Check" Actions](#example-together-with-create-a-release-and-version-check-actions)
- [License](#license)
---
## About
This action collects all git commit messages from a git repository since the last git tag and provides them as output
list together with the last git tag.
To make the necessary information available, the repository needs to be checked out with tags and history.
(e.g. using `actions/checkout` with `fetch-depth: 0`)
## Usage
### Inputs
| Name | Description | Type | Default |
| ---------------- | --------------------------------------------------- | ------- | ------- |
| `line-prefix` | prefix to add to every collected commit message | String | `"- "` |
| `include-hashes` | whether or not the commit hashes should be included | Boolean | `true` |
### Outputs
| Name | Description | Type |
| ---------- | -------------------------------------------- | ------ |
| `last-tag` | last tag from where on changes are collected | String |
| `log` | collected commit messages | String |
If the repository does not have any tags present, `last-tag` will be _null_ and `log` will be all prior commit messages.
### Simple Example
```yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # [!] we need to checkout with tags and commit history
- name: 📋 Get Commits since last Release
id: changes
uses: simbo/changes-since-last-release-action@v1
- name: 📣 Output collected Data
run: |
echo "Changes since ${{ steps.changes.outputs.last-tag }}:"
echo "${{ steps.changes.outputs.log }}"
```
Output:
```txt
Changes since 0.1.0:
- 7e6b5f6 bump version
- 4aeb444 another change
- a7d21d6 fix something
```
### Example with optional Inputs
```yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # [!] we need to checkout with tags and commit history
- name: 📋 Get Commits since last Release
id: changes
uses: simbo/changes-since-last-release-action@v1
with:
line-prefix: "* "
include-hashes: false
- name: 📣 Output collected Data
run: |
echo "Changes since ${{ steps.changes.outputs.last-tag }}:"
echo "${{ steps.changes.outputs.log }}"
```
Output:
```txt
Changes since 0.1.0:
* bump version
* another change
* fix something
```
### Example together with "Create a Release" and "Version Check" Actions
A common usecase is to use this action's output together with the actions
["Create a Release"](https://github.com/marketplace/actions/create-a-release) and
["Version Check"](https://github.com/marketplace/actions/version-check):
```yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # [!] we need to checkout with tags and commit history
- name: 👀 Check for Version Update
id: version
uses: EndBug/version-check@v1
with:
file-url: https://unpkg.com/my-awesome-package/package.json
static-checking: localIsNew
- name: 📋 Get Commits since last Release
if: steps.version.outputs.changed == 'true'
id: changes
uses: simbo/changes-since-last-release-action@v1
- name: 🎁 Create Tag and GitHub Release
if: steps.version.outputs.changed == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: Release ${{ steps.version.outputs.version }}
body: |
Changes since ${{ steps.changes.outputs.last-tag }}:
${{ steps.changes.outputs.log }}
```
## License
[MIT © 2020 Simon Lepel](http://simbo.mit-license.org/2020/)