W
W
WbICHA2020-10-28 17:17:33
GitHub
WbICHA, 2020-10-28 17:17:33

GitHub Actions. Why is env. var.?

I decided to push an action that increases the patch version in package jason, but I ran into an incomprehensible problem (for the first time I work with yaml and actions). For some reason, the env var I created is no longer used, despite the fact that it definitely is.

My action code
name: Bump version
on:
  push:
    branches:
      - dev
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/[email protected]
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Patch
        id: version
        run: echo "version=$(npm version patch --no-git-tag-version)" >> $GITHUB_ENV

      - name: Add & Commit & Push
        uses: EndBug/add-and[email protected]
        with:
          add: 'package.json package-lock.json'
          message: 'Version $version'
          tag: $version
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

According to the env var logs, there is and it is correct
with:
    add: package.json package-lock.json
    message: Version $version
    tag: $version
    cwd: .
  env:
    version: v1.0.1
    GITHUB_TOKEN: ***

But the output is still "$version": What am I doing wrong? Based on what I understood from the documentation, everything should work, but no. :/ PS: if someone knows better ways to change the patch version, I will be glad to consider them.
> Using "Version $version" as commit message.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question