test de config 20 #87
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /.github/workflows/release.yml | |
name: Generate Detailed Release Notes and Create Draft Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
generate-release-notes: | |
runs-on: ubuntu-latest | |
env: | |
owner: ${{ github.repository_owner }} | |
repo: ${{ github.repository }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Get Latest and Previous Tags | |
id: tags | |
run: | | |
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1)) | |
previous_tag=$(git describe --tags $(git rev-list --tags=$latest_tag --max-count=2 | tail -n 1)) | |
echo "::set-output name=latest_tag::$latest_tag" | |
echo "::set-output name=previous_tag::$previous_tag" | |
- name: Generate Detailed Changelog Content | |
id: generate_changelog | |
run: | | |
echo "::group::Generating Detailed Changelog" | |
prev_tag=${{ steps.tags.outputs.previous_tag }} | |
latest_tag=${{ steps.tags.outputs.latest_tag }} | |
CHANGELOG=$(git log --pretty=format:"* [%h](https://github.com/$owner/$repo/commit/%h) %s (%cn)" ${{ steps.tags.outputs.previous_tag }}..$latest_tag) | |
if [[ -z "$CHANGELOG" ]]; then | |
CHANGELOG="No changes since latest tag." | |
fi | |
echo "$CHANGELOG" | |
echo "::endgroup::" | |
echo "::set-output name=changelog::$CHANGELOG" | |
- name: Create Draft Release with Detailed Changelog | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: "**Release Notes for ${{ github.ref }}**" # Clear release name | |
body: | | |
**Detailed Changelog:** | |
${{ steps.generate_changelog.outputs.changelog }} | |
draft: true |