My github actions code is as follows. I want to save the version to Environment.
name: Windows x64 Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 14
uses: actions/setup-java@v2
with:
java-version: 14
distribution: 'adopt'
architecture: x64
javafx: true
- name: Get version
run: echo project_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $GITHUB_ENV
when I run it I get this error and I couldn't find a solution.
Run echo project_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $GITHUB_ENV
echo project_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $GITHUB_ENV
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
JAVA_HOME: C:\hostedtoolcache\windows\Java_Adopt_jdk\14.0.2-12\x64
Error: Process completed with exit code 1.
I'll be happy if you can help me.