I have a Github action command that is really long:
name: build
on: [push]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Install Prerequisites
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends "a very very long list of prerequisites"
May I know whether it is possible to split the long command into multiple lines for better readability? I have tried the separator '' but it does not work.
I have a multi line command using backslash to separate the lines as follows:
- name: Configure functions
run: |
firebase functions:config:set \
some.key1="${{ secrets.SOME_KEY_1 }}" \
some.key2="${{ secrets.SOME_KEY_2 }}" \
...
Note the preceding '|' character.
You can use the YAML folded style with >
which is supported by GitHub Actions.
For example,
run: >
xvfb-run
./mvnw -f my/pom.xml
clean verify
-DskipTests
newlines will be replaced with spaces so the above is equivalent to
run: xvfb-run ./mvnw -f my/pom.xml clean verify -DskipTests
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With