From 71906d1ff611f6370799098ddc58d3b6bd6ec602 Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Wed, 13 Sep 2023 10:50:08 +0200 Subject: [PATCH] Get Tag Info --- .github/workflows/release.yml | 46 ++++++++++++++--------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 651c959..fab91de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,34 +17,24 @@ jobs: tag_name: ${{ steps.get_tag_name.outputs.tag_name }} }} tag_message: ${{ steps.get_tag_message.outputs.tag_message }} steps: - - name: Add Git Identity - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Get tag message - id: get_tag_message - run: | - TAG_MESSAGE=$(git for-each-ref refs/tags/0.1.3 --format '%(contents)') - echo "TAG_MESSAGE=$TAG_MESSAGE" >> $GITHUB_ENV - - name: Print tag message - run: | - echo "Tag Message: $TAG_MESSAGE" - - name: Get last tag name - id: get_tag_name - run: echo "tag_name=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT - # - name: Get last tag message - # id: get_tag_message - # run: | - # echo "tag_message=$(git tag -l ${{ steps.get_tag_name.outputs.tag_name }} --format='%(contents)')" >> $GITHUB_OUTPUT - - name: Print Outputs - run: | - echo "Tag Name: ${{ steps.get_tag_name.outputs.tag_name }}" - echo "Tag Message: ${{ steps.get_tag_message.outputs.tag_message }}" - echo "tag_message=$(git tag -l 0.1.3 --format='%(contents)')" + - name: Checkout code + uses: actions/checkout@v4 + - name: Get Tag Name + id: get_tag_name + run: | + echo "tag_name=${{ github.ref_name }}" >> $GITHUB_OUTPUT + echo "Tag Name: ${{ github.ref_name }}" + - name: Get Tag Message + id: get_tag_message + run: | + git fetch --depth=1 origin +refs/tags/*:refs/tags/* + tm=$(git tag -l --format='%(contents:subject)' ${{ steps.get_tag_name.outputs.tag_name }}) + echo "Tag Message: $tm" + echo "tag_message=$tm" >> $GITHUB_OUTPUT + - name: Print Output + run: | + echo "Tag Name: ${{ steps.get_tag_name.outputs.tag_name }}" + echo "Tag Message: ${{ steps.get_tag_message.outputs.tag_message }}" # run_copy_script: # runs-on: macos-latest