fabriziosalmi / UglyFeed

Retrieve, aggregate, filter, evaluate, rewrite and serve RSS feeds using Large Language Models for fun, research and learning purposes.
GNU Affero General Public License v3.0
118 stars 3 forks source link

Enrich release message #26

Open fabriziosalmi opened 3 months ago

fabriziosalmi commented 3 months ago

Is your feature request related to a problem? Please describe. Enrich release commit message

Describe the solution you'd like

- name: Get the current version from setup.py
  id: current_version
  run: |
    CURRENT_VERSION=$(python -c "import setup; print(setup.__version__)")
    echo "current_version=$CURRENT_VERSION" >> $GITHUB_ENV

- name: Get the previous version from git tags
  id: previous_version
  run: |
    PREVIOUS_VERSION=$(git tag --sort=-creatordate | grep -E 'v[0-9]+\.[0-9]+\.[0-9]+' | sed -n '2p')
    echo "previous_version=$PREVIOUS_VERSION" >> $GITHUB_ENV

- name: Get the list of commits between the previous and current version
  id: commit_list
  run: |
    if [ -n "$PREVIOUS_VERSION" ]; then
      git log $PREVIOUS_VERSION..HEAD --pretty=format:"%h %s" > commit_list.txt
    else
      echo "No previous version found, listing all commits" > commit_list.txt
      git log --pretty=format:"%h %s" >> commit_list.txt
    fi
    echo "commits=$(cat commit_list.txt)" >> $GITHUB_ENV

- name: Enrich release message with commit list
  id: enrich_release_message
  run: |
    COMMIT_LIST=$(cat commit_list.txt)
    RELEASE_MESSAGE=$(echo -e "## Release Notes\n\n### Commits:\n$COMMIT_LIST")
    echo "release_message=$RELEASE_MESSAGE" >> $GITHUB_ENV