Skip to content

Commit

Permalink
yaml is dynamically typed
Browse files Browse the repository at this point in the history
  • Loading branch information
aryairani committed Mar 24, 2024
1 parent 7b5d0d8 commit 886a55b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/bundle-ucm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ jobs:
name: unison-${{matrix.os}}
path: ${{env.staging_dir}}/
- name: restore permissions on ucm
if: ${{runner.os}} != 'Windows'
run: chmod +x ${{env.staging_dir}}/unison
- name: rename unison -> ucm
run: mv ${{env.staging_dir}}/unison ${{env.staging_dir}}/ucm
Expand All @@ -219,7 +218,10 @@ jobs:
name: unison-runtime-${{matrix.os}}
path: ${{env.staging_dir}}/runtime
- name: restore permissions on unison-runtime
if: ${{runner.os}} != 'Windows'
# here we have the `if:` not because of the missing .exe on Windows,
# nor the lack of need to chmod, but because /runtime/bin/ probably doesn't exist
# due to differences in `raco distribute` on Windows vs macOS and Linux.
if: runner.os != 'Windows'
run: chmod +x ${{env.staging_dir}}/runtime/bin/unison-runtime
- name: download latest unison-local-ui
run: |
Expand Down
6 changes: 6 additions & 0 deletions docs/github-actions-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ e.g.
It's not clear to me when to use `$GITHUB_OUTPUT` vs `$GITHUB_ENV`, but I have been favoring `$GITHUB_ENV` because it requires fewer characters to access.
However, it seems a little wrong.

### `if:`

Although the type rules don't totally make sense in Github Actions, `if:` takes a Boolean.

Therefore, I think the String interpolation in `if: ${{runner.os}} != 'Windows'` causes the whole expression to become a String, which is coerced to `true`, when you definitely didn't mean `if: true`. So don't use `${{}}` here.

### Job names

Job names will automatically get `(${{matrix.os}})` if you don't use `${{matrix.os}}` somewhere in the name.
Expand Down

0 comments on commit 886a55b

Please sign in to comment.