I am facing an issue with GitHub action. Despite configuring the README.md
via a web browser, I encountered an error in GitHub action:
Run export BUILD_VERSION=$(grep version package.json | awk -F \" '{print $4}')
export BUILD_VERSION=$(grep version package.json | awk -F \" '{print $4}')
echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV
shell: /usr/bin/bash -e {0}
Error: Unable to process file command 'env' successfully.
Error: Invalid environment variable format 'Indicate that a variable can have the value `null`. Null-Safety is default from version **2.12.0** in the Dart language.'
The error message seems related to the text within the README.md
, and regardless of any edits made, it continues to display the same old error. I attempted to search for a solution online but couldn't find anything similar.
- My current variable format is as follows:
Null-Safety is enabled by default, indicating that a variable may contain a null value. This change is mandatory in the new Dart language starting from version 2.12.0.
Below is my workflow file:
name: release master branch
on:
push:
branches:
- master
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: install dependencies
run: npm install
- name: install vsce
run: sudo npm install -g vsce
- name: extract version number
run: |
export BUILD_VERSION=$(grep version package.json | awk -F \" '{print $4}')
echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV
- name: package the extension
run: vsce package
- name: release package to github repo
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: master-v${{ env.BUILD_VERSION }}
prerelease: true
title: 'Json to Dart Extension master-v${{ env.BUILD_VERSION }}'
files: |
./json-to-dart-${{ env.BUILD_VERSION }}.vsix
Adding paths ignore does not seem to fix the issue.
on:
push:
branches:
- master
paths-ignore:
- '**/README.md'
You can access the full code publicly on this repository: https://github.com/hiranthaR/Json-to-Dart-Model
Here's a partial log snapshot:
...
2021-08-02T19:38:38.3085331Z ##[group]Run sudo npm install -g vsce
2021-08-02T19:38:38.3086141Z [36;1msudo npm install -g vsce[0m
2021-08-02T19:38:38.3129504Z shell: /usr/bin/bash -e {0}
2021-08-02T19:38:42.3974877Z /usr/local/bin/vsce -> /usr/local/lib/node_modules/vsce/out/vsce
2021-08-02T19:38:42.4134841Z + <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2b5d58484e6b1a05121d051a">[email protected]</a>
2021-08-02T19:38:42.4135550Z added 73 packages from 42 contributors in 3.582s
2021-08-02T19:38:42.4443780Z ##[group]Run export BUILD_VERSION=$(grep version package.json | awk -F \" '{print $4}')
2021-08-02T19:38:42.4444834Z [36;1mexport BUILD_VERSION=$(grep version package.json | awk -F \" '{print $4}')[0m
2021-08-02T19:38:42.4445782Z [36;1mecho "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV[0m
2021-08-02T19:38:42.4489050Z shell: /usr/bin/bash -e {0}
2021-08-02T19:38:42.4690016Z ##[error]Unable to process file command 'env' successfully.
2021-08-02T19:38:42.4703378Z ##[error]Invalid environment variable format 'Indicate that a variable can have the value `null`. Null-Safety is default from version **2.12.0** in the Dart language.'
2021-08-02T19:38:42.4890985Z Post job cleanup.
...