Skip to content

Commit

Permalink
config 28
Browse files Browse the repository at this point in the history
test 28
  • Loading branch information
alternative-rvb committed Mar 13, 2024
1 parent 6905729 commit 0ab7db2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Generate Detailed Release Notes and Create Draft Release
on:
push:
tags:
- "*"
- '*'

jobs:
generate-release-notes:
Expand Down Expand Up @@ -37,36 +37,35 @@ jobs:
latest_tag=${{ steps.tags.outputs.latest_tag }}
echo "Previous Tag: $prev_tag"
echo "Latest Tag: $latest_tag"
# Vérifier si la plage de balises est vide
if [[ -z "$prev_tag" || -z "$latest_tag" ]]; then
echo "::error::Invalid tag range."
exit 1
fi
# Vérifier s'il y a des commits dans la plage
if [[ "$(git rev-list $prev_tag..$latest_tag --count)" -eq 0 ]]; then
echo "::warning::No commits found in tag range."
# Vérifier si le fichier suivi est modifié
if [[ ! "$(git diff --name-only $prev_tag..$latest_tag)" =~ .*\.md ]]; then
echo "::warning::No changes to tracked files in tag range."
exit 0
fi

CHANGELOG=$(git log --all --pretty=format:"* [%h](https://github.com/$owner/$repo/commit/%h) %s (%cn)" $prev_tag..$latest_tag)
# Afficher tous les commits, même sans modifications de fichiers
CHANGELOG=$(git log --all --oneline $prev_tag..$latest_tag)
if [[ -z "$CHANGELOG" ]]; then
CHANGELOG="No changes since latest tag."
fi
echo "Generated Changelog: $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
release_name: "**Release Notes for ${{ github.ref }}**" # Clear release name
body: |
**Detailed Changelog:**
Expand Down

0 comments on commit 0ab7db2

Please sign in to comment.