From 7616bd2c07749cc2e510312f56b6f149c8f74130 Mon Sep 17 00:00:00 2001 From: mustakshif Date: Mon, 27 May 2024 01:05:44 +0800 Subject: [PATCH] fix symbol caused workflow error --- .github/workflows/main.yml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b8ee763..0f1dca5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,43 +25,27 @@ jobs: echo "Error: $CHANGELOG_FILE does not exist." exit 1 fi - # Use awk to extract the latest changelog entry CHANGELOG_CONTENT=$(awk '/^### / {if (found) exit; found=1} found' "$CHANGELOG_FILE") - if [ -z "$CHANGELOG_CONTENT" ]; then echo "Error: Could not extract the latest changelog entry." exit 1 fi - echo "Extracted changelog content:" echo "$CHANGELOG_CONTENT" - # Save the changelog content to the environment file using the multi-line syntax - echo "CHANGELOG_CONTENT<> $GITHUB_ENV - echo "$CHANGELOG_CONTENT" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Debug changelog content - run: | - echo "DEBUG: ${{ env.CHANGELOG_CONTENT }}" + echo "CHANGELOG_CONTENT='$CHANGELOG_CONTENT'" >> $GITHUB_ENV - name: Create or update annotated tag with changelog run: | TAG_NAME="${{ github.ref_name }}" CHANGELOG_CONTENT="${{ env.CHANGELOG_CONTENT }}" - - # Save the changelog content to a temporary file using heredoc -cat < CHANGELOG_TEMP.txt -$CHANGELOG_CONTENT -EOF - if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then echo "Tag $TAG_NAME already exists. Updating tag message." - git tag -f -a "$TAG_NAME" -F CHANGELOG_TEMP.txt + git tag -f -a "$TAG_NAME" -m "$CHANGELOG_CONTENT" git push origin -f "$TAG_NAME" else - git tag -a "$TAG_NAME" -F CHANGELOG_TEMP.txt + git tag -a "$TAG_NAME" -m "$CHANGELOG_CONTENT" git push origin "$TAG_NAME" fi