From 88f66c8b2f599b6c4fbb93f0f7195411cfba44ba Mon Sep 17 00:00:00 2001 From: Atharva Date: Mon, 1 Jul 2024 16:58:27 +0530 Subject: [PATCH] fix: display repo name as title for releases --- .github/workflows/release.yml | 45 +++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 041c4b5..cd4e866 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,24 +1,39 @@ name: Release project + on: - push: - branches: ['main'] + push: + branches: ['main'] permissions: - contents: read + contents: read jobs: - release: - permissions: - contents: write # to be able to publish a GitHub release + release: + permissions: + contents: write # to be able to publish a GitHub release + + name: Release + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 - name: Release - runs-on: ubuntu-latest + - name: Get the latest tag version + id: get_version + run: echo "TAG=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV - steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Create release title + id: create_title + run: | + REPO_NAME=$(basename $GITHUB_REPOSITORY) + VERSION=$TAG + RELEASE_TITLE="$REPO_NAME v$VERSION" + echo "RELEASE_TITLE=$RELEASE_TITLE" >> $GITHUB_ENV - - name: Release - uses: huggingface/semver-release-action@latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Release + uses: huggingface/semver-release-action@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_title: ${{ env.RELEASE_TITLE }}