I need to read text from a local file, usually in bash execution cat ./fileName
, so I took it for granted
echo "FILE_TEXT=$(cat ./file.txt)" >> $GITHUB_ENV
Then report the error as follows
Error: Unable to process file command 'env' successfully.
Error: Invalid environment variable format 'xxxxxxxxxx... '
The reason is because setting $GITHUB_ENV
the environment variable does not directly support multiple lines of text, plus get EOF
the job
following this set on it
name: "Read the text"
run: |
echo 'FILE_TEXT<<EOF' >> $GITHUB_ENV
cat ./file.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
run: |
It is to run multi-line shell commands. Local variables can be obtained in this step. Those who need to obtain values across steps must be written $GITHUB_ENV
to, and then the reading method is as follows:
${{env.FILE_TEXT}}
Similar Posts:
- CentOS Error -bash:systemctl:command not found
- Mac ADB prompts command not found
- Linux cron has no effect after executing the script, and the log reports an error orphan (no passwd entry)
- [Solved] JSCH cannot run JAVA bash:java:Command not found.
- How to Replace log4j with shell Script in Bulk
- [Solved] Cannot run program “git.exe”: CreateProcess error=
- Loading local data is disabled; this must be enabled on both the client and server sides
- -bash: ls: command not found [How to Solve]
- Linux use the man command error: Man: command not found [How to Solve]
- FreeMind Open Warning: the registry refers to a nonexiste