From b6df3a52ce3c79cc0eeb865535e1df1a9d17336f Mon Sep 17 00:00:00 2001 From: foxriver76 Date: Tue, 23 Jul 2024 17:55:10 +0200 Subject: [PATCH] try to use env vars --- .github/workflows/create-release.yml | 10 +++------ .github/workflows/test-and-release.yml | 29 +++++++++++++------------- README.md | 2 +- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 22a53c6..a8052a1 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -56,18 +56,15 @@ jobs: const package = require('./package.json'); return package.version - - name: Extract the version and commit body from the tag + - name: Extract the commit body id: extract_release # The body may be multiline, therefore we need to escape some characters run: | - VERSION="${{ github.ref }}" - VERSION=${VERSION##*/v} - echo "::set-output name=VERSION::$VERSION" BODY=$(git show -s --format=%b) BODY="${BODY//'%'/'%25'}" BODY="${BODY//$'\n'/'%0A'}" BODY="${BODY//$'\r'/'%0D'}" - echo "::set-output name=BODY::$BODY" + echo "COMMIT_BODY=$BODY" >> $GITHUB_ENV - name: Create Pull Request id: cpr @@ -81,8 +78,7 @@ jobs: branch: official-release delete-branch: true title: "[OFFICIAL RELEASE] ${{ steps.version.outputs.result }}" - body: | - ${{ steps.extract_release.outputs.BODY }} + body: $COMMIT_BODY labels: | automated pr 🔧 assignees: foxriver76 diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 0176d46..d752475 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -49,6 +49,19 @@ jobs: os: ${{ matrix.os }} build: false + extract-commit: + if: steps.automerge.outputs.mergeResult == 'merged' + # The body may be multiline, therefore we need to escape some characters + runs-on: ubuntu-latest + steps: + - name: Extract Commit + run: | + BODY=$(git show -s --format=%b) + BODY="${BODY//'%'/'%25'}" + BODY="${BODY//$'\n'/'%0A'}" + BODY="${BODY//$'\r'/'%0D'}" + echo "COMMIT_BODY=$BODY" >> $GITHUB_ENV + auto-merge: if: | always() && @@ -101,20 +114,6 @@ jobs: npm whoami npm publish - - name: Extract the version and commit body from the tag - if: steps.automerge.outputs.mergeResult == 'merged' - id: extract_release - # The body may be multiline, therefore we need to escape some characters - run: | - VERSION="${{ github.ref }}" - VERSION=${VERSION##*/v} - echo "::set-output name=VERSION::$VERSION" - BODY=$(git show -s --format=%b) - BODY="${BODY//'%'/'%25'}" - BODY="${BODY//$'\n'/'%0A'}" - BODY="${BODY//$'\r'/'%0D'}" - echo "::set-output name=BODY::$BODY" - - name: Create Github Release if: steps.automerge.outputs.mergeResult == 'merged' uses: ncipollo/release-action@v1 @@ -125,5 +124,5 @@ jobs: name: Release v${{ steps.version.outputs.result }} draft: false prerelease: ${{ contains(steps.version.outputs.result, '-') }} - body: ${{ steps.extract_release.outputs.BODY }} + body: $COMMIT_BODY diff --git a/README.md b/README.md index 3abe062..650beff 100644 --- a/README.md +++ b/README.md @@ -908,7 +908,7 @@ The adapter is tested with an DENON AVR-X1200W and a Marantz SR5009. Placeholder for the next version (at the beginning of the line): ### __WORK IN PROGRESS__ --> -### 1.15.10 (2024-07-23) +### __WORK IN PROGRESS__ * (foxriver76) updated dependencies * (foxriver76) added tier and license information * (foxriver76) fixed invalid object `denon.0`