test de config 17 #84
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: Identify Previous Tag (Optional) | |
id: prev_tag | |
run: | | |
git fetch --depth=1 origin | |
if [[ $(git describe --abbrev=0 --tags HEAD^) ]]; then | |
echo "::set-output name=prev_tag::$(git describe --abbrev=0 --tags HEAD^)" | |
else | |
echo "::set-output name=prev_tag::" # No previous tag found | |
fi | |
- name: Get Latest Commit Info | |
id: latest_commit | |
run: | | |
echo "::set-output name=commit_hash::$(git log -1 --format='%H')" | |
echo "::set-output name=commit_message::$(git log -1 --format='%s')" | |
- name: Generate Detailed Changelog Content | |
id: generate_changelog | |
run: | | |
echo "::group::Generating Detailed Changelog" | |
prev_tag=${{ steps.prev_tag.outputs.prev_tag }} # Optional: Use prev_tag if available | |
if [[ $prev_tag ]]; then | |
CHANGELOG=$(git log --pretty=format:"* [%h](https://github.com/$owner/$repo/commit/%h) %s (%cn)" $prev_tag..HEAD) | |
else | |
CHANGELOG=$(git log --pretty=format:"* [%h](https://github.com/$owner/$repo/commit/%h) %s (%cn)") | |
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 |