42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
|
name: env-and-path
|
||
|
on: push
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: "Append to $GITHUB_PATH"
|
||
|
run: |
|
||
|
echo "$HOME/someFolder" >> $GITHUB_PATH
|
||
|
- name: "Append some more to $GITHUB_PATH"
|
||
|
run: |
|
||
|
echo "$HOME/someOtherFolder" >> $GITHUB_PATH
|
||
|
- name: "Check PATH"
|
||
|
run: |
|
||
|
if [[ ! "${PATH}" =~ .*"$HOME/"someFolder.*"$HOME/"someOtherFolder ]]; then
|
||
|
echo "${PATH} doesn't match .*someFolder.*someOtherFolder"
|
||
|
exit 1
|
||
|
fi
|
||
|
- name: "Write single line env to $GITHUB_ENV"
|
||
|
run: |
|
||
|
echo "KEY=value" >> $GITHUB_ENV
|
||
|
- name: "Check single line env"
|
||
|
run: |
|
||
|
if [[ "${KEY}" != "value" ]]; then
|
||
|
echo "${KEY} dosen't == 'value'"
|
||
|
exit 1
|
||
|
fi
|
||
|
- name: "Write multiline env to $GITHUB_ENV"
|
||
|
run: |
|
||
|
echo 'KEY2<<EOF' >> $GITHUB_ENV
|
||
|
echo value2 >> $GITHUB_ENV
|
||
|
echo 'EOF' >> $GITHUB_ENV
|
||
|
- name: "Check multiline line env"
|
||
|
run: |
|
||
|
if [[ "${KEY2}" != "value2" ]]; then
|
||
|
echo "${KEY2} dosen't == 'value'"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
|