-
Notifications
You must be signed in to change notification settings - Fork 451
Set shell: bash by default on all workflows
#3091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
1b8f0ff
0c065fa
c778749
3bf58bb
d797efb
856e1e5
4e1dadc
2b7d487
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,10 @@ jobs: | |
| timeout-minutes: 45 | ||
|
|
||
| steps: | ||
| - name: Prepare git (Windows) | ||
| if: runner.os == 'Windows' | ||
| run: git config --global core.autocrlf false | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm mildly surprised that there isn't an option for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Node.js | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ set -e | |
|
|
||
| cd "$(dirname "$0")" | ||
| python3 -m venv env | ||
| source env/bin/activate | ||
| source env/*/activate | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python 🤯 🤦🏻♂️ |
||
| pip3 install ruamel.yaml==0.17.31 | ||
| python3 sync.py | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Checking
matrix.os == 'windows-latest'might be a bit easier to work with here, since the string appears in the matrix and is therefore less of a magic value. I.e. without checking what possible valuesrunner.oshas, I wouldn't be sure that'Windows'is correct.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the other hand, checking
runner.oswill work even if we change the runners (for example pinning the runner version) or if we copy such a snippet in another workflow. All in all, I prefer the stability and independence of context ofrunner.os, it's just less prone to errors. One thing to note, all string comparisons on actions are case insensitive, sorunner.os == 'windows'works as well.runner.osandrunner.archare good things to keep in mind when writing workflows.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment was less about whether string comparison is case-sensitive or what
runnerproperties exist, but more thatrunner.oscould theoretically have other plausible values like'win'or'win11'etc. -- we know as routine Actions users that this may not be the case, but it is not as obvious generally as thematrix.oscomparison.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
runner.osis fairly stable - it's always one ofLinux/Windows/macOSaccording to https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#runner-context (and we've relied on that in the past). Agree it's not super obvious from your workflow though.