Skip to content

2.6.2

2.6.2 #9

name: 'Generate Changelog'
on:
push:
tags:
- 'v*'
jobs:
Changelog:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Git repository with history for all branches and tags'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Set current Git tag'
run: echo "CURRENT_TAG=$(git tag --points-at ${{github.sha}})" >> "$GITHUB_ENV"
- name: 'Set previous Git tag'
run: echo "PREVIOUS_TAG=$(git describe --tags --abbrev=0 --exclude ${CURRENT_TAG})" >> "$GITHUB_ENV"
- name: 'Print environment variables'
run: |
echo -e "PREVIOUS_TAG = ${PREVIOUS_TAG}"
echo -e "CURRENT_TAG = ${CURRENT_TAG}"
echo -e "Node.js version = $(node --version)"
- name: 'Generate changelog'
run: |
echo "{}" > ./package.json
npx [email protected] -t ${PREVIOUS_TAG}...${CURRENT_TAG}
- name: 'Attach changelog to tag'
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{github.token}}
with:
tag_name: ${{env.CURRENT_TAG}}
name: ${{env.CURRENT_TAG}}
body_path: ./CHANGELOG.md
draft: false
prerelease: false