Skip to content
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

小文字への変換ロジックを tr ベースに変更 #4

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

tshion
Copy link
Owner

@tshion tshion commented Apr 29, 2024

#2 のマージ後、GitHub Actions を実行したところ、macOS で bad substitution が発生した。
原因はmacOS のBash は3.x で、Bash 4.x から導入された ${USER,,} が使えないため。
なので小文字への変換ロジックを tr を使ったものに変更した。

参考: https://x.com/raki/status/1784872625019224113

@tshion tshion self-assigned this Apr 29, 2024
@tshion tshion merged commit ab3fe9a into main Apr 29, 2024
@tshion tshion deleted the feature/ignore_case_sensitive_2 branch April 29, 2024 09:24
@@ -32,7 +32,7 @@ runs:

email=''
name=''
user=${USER,,}
user=$(echo $USER | tr [A-Z] [a-z])
if [ $user = 'actions-user' ]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input.user が空だった時にこの if 文は [: =: unexpected operator みたいになっちゃう気がする。。。
16行目の user に default で適当な文字列を突っ込む(error的な)とか、
if [ "$user" = 'actions-user' ]; then みたいにしておくとシェルとして安全。というおせっかい。

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。改良したいと思います 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants