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
name: Generate Release Notes and Create Draft Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
generate-release-notes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # Récupère tout l'historique du dépôt pour obtenir tous les commits | |
- 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')" | |
echo "::set-output name=tag_name::$(git describe --tags --abbrev=0)" | |
- name: Generate Changelog Content | |
id: generate_changelog | |
run: | | |
echo "::group::Generating Changelog" | |
CHANGELOG=$(git log --pretty=format:"* %s (%cn)") | |
echo "$CHANGELOG" | |
echo "::endgroup::" | |
echo "::set-output name=changelog::$CHANGELOG" | |
- name: Create Draft Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.event.repository.name }}-${{ steps.latest_commit.outputs.tag_name }} | |
body: ${{ steps.generate_changelog.outputs.changelog }} | |
draft: true |