Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enrich release message #26

Open
fabriziosalmi opened this issue Jun 23, 2024 · 0 comments
Open

Enrich release message #26

fabriziosalmi opened this issue Jun 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@fabriziosalmi
Copy link
Owner

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
@fabriziosalmi fabriziosalmi added the enhancement New feature or request label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant