Skip to content

Commit d6a07e1

Browse files
committed
Tweak wording about SHELLOPTS and line-endings
1 parent 63d1e75 commit d6a07e1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Parameters
3333
Line endings
3434
------------
3535

36+
### in the checkout
37+
3638
If you're going to use `actions/checkout` in your workflow, you should
3739
precede that with
3840

@@ -41,17 +43,22 @@ precede that with
4143
to ensure that any shell scripts etc. in your repository don't get checked out
4244
with `\r\n` line endings (leading to `'\r': command not found` errors).
4345

46+
### in the workflow
47+
4448
Likewise, if you have multiple lines of shell script in a YAML block for `run:`
4549
in your workflow file, the file this is written into on the runner ends up with
4650
`\r\n` line endings.
4751

4852
You can use `>-` (rather than `|`) to ensure that it doesn't contain any
4953
newlines.
5054

51-
Alternatively, you can also use:
55+
Alternatively, you can invoke `bash` with `-o igncr`.
5256

53-
- invoke `bash` with `-o igncr`
54-
- `igncr` in the `SHELLOPTS` environment variable (**Warning:** by default, `SHELLOPTS` is a shell variable and moving it to the environment causes all shell options to propagate to child shells)
57+
**Warning:**
58+
Putting `igncr` in the `SHELLOPTS` environment variable seems like it should
59+
have the same effect, but this can have unintended side-effects (by default,
60+
`SHELLOPTS` is a shell variable and moving it to the environment causes **all**
61+
shell options to propagate to child shells).
5562

5663
PATH
5764
----

0 commit comments

Comments
 (0)