Use environment variable on Create a Release

I’m trying to create a release step in my Action that gets the TAG name from an Environment variable.

This is my step:

- name: Create GitHub Release
        uses: actions/create-release@v1
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          commitish: master
          tag_name: v{{ env.PROJECT_VERSION }}
          release_name: Release {{ env.PROJECT_VERSION }}
          body_path: ${{ github.workspace }}/
          draft: false
          prerelease: false

PROJECT_VERSION was set in a previous step using echo "PROJECT_VERSION=content" >> $GITHUB_ENV

The idea is that the tag would end up beint “v” + “PROJECT_VERSION”, so a common v1.0.0.

Oddly enough ${{ github.workspace }} is parsed properly but {{ env.PROJECT_VERSION }} isn’t.

Any ideas?

Probably because the $ in front of the opening {{ is missing in these two lines.

1 Like

Omg I feel so stupid, I should have a better linter or something. Thank!.

1 Like