From 0c4292571ed14f9b4b83ff3abef30104b4fa11b6 Mon Sep 17 00:00:00 2001 From: dogi Date: Mon, 15 Sep 2025 22:17:42 -0400 Subject: [PATCH] Use GITHUB_ENV for workflow variables --- .github/workflows/newversion.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/newversion.yml b/.github/workflows/newversion.yml index 5acea6ea5..3b7e140b1 100644 --- a/.github/workflows/newversion.yml +++ b/.github/workflows/newversion.yml @@ -17,6 +17,10 @@ jobs: with: node-version: 20 registry-url: https://registry.npmjs.org/ + - name: prepare environment + run: | + echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV" + echo "discord_channel=${{ secrets.CHANNEL }}" >> "$GITHUB_ENV" - name: build run: | ./templates/blocker/blocker.sh @@ -33,8 +37,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} + tag_name: ${{ env.TAG_NAME }} + release_name: ${{ env.TAG_NAME }} body: | ${{ github.event.head_commit.message }} draft: false @@ -46,5 +50,4 @@ jobs: - name: report run: | sudo npm install -g @treehouses/cli - export discord_channel="${{ secrets.CHANNEL }}" - treehouses feedback "new [treehouses/cli](https://github.com/treehouses/cli) release **[$( echo ${{ github.ref }} | cut -d'/' -f3 )](https://www.npmjs.com/package/@treehouses/cli/v/$( echo ${{ github.ref }} | cut -d'/' -f3 ))**" + treehouses feedback "new [treehouses/cli](https://github.com/treehouses/cli) release **[${TAG_NAME}](https://www.npmjs.com/package/@treehouses/cli/v/${TAG_NAME})**"