Skip to content

Commit 05562b2

Browse files
committed
Use case instead of && and || in GitHub Actions
1 parent 064377b commit 05562b2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.github/workflows/build-executable.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ jobs:
6767
X86_64_PC_WINDOWS_MSVC_OPENSSL_INCLUDE_DIR: C:\Program Files\OpenSSL\include
6868
X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR: C:\Program Files\OpenSSL\lib\VC\x64\MD
6969
run: |
70-
cargo build --target-dir="${{ runner.temp }}/artifacts" ${{ inputs.release && '--release' || '' }}
70+
cargo build --target-dir="${{ runner.temp }}/artifacts" ${{ case(inputs.release || false, '--release', '') }}
7171
- name: Upload
7272
if: ${{ inputs.upload || false }}
7373
uses: actions/upload-artifact@v6
7474
with:
7575
name: artifacts-api-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
76-
path: ${{ runner.temp }}/artifacts/release/hoarder${{ matrix.platform.os == 'windows' && '.exe' || '' }}
76+
path: ${{ runner.temp }}/artifacts/release/hoarder${{ case(matrix.platform.os != 'windows', '', '.exe') }}
7777
if-no-files-found: error
7878
retention-days: 1

.github/workflows/publish-executable.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ jobs:
4949
- name: Compress
5050
uses: TheDoctor0/zip-release@0.7.6
5151
with:
52-
type: ${{ matrix.platform.os == 'windows' && 'zip' || 'tar' }}
53-
filename: ${{ runner.temp }}/hoarder-${{ matrix.platform.os }}-${{ matrix.platform.arch }}.${{ matrix.platform.os == 'windows' && 'zip' || 'tar.gz' }}
52+
type: ${{ case(matrix.platform.os != 'windows', 'tar', 'zip') }}
53+
filename: ${{ runner.temp }}/hoarder-${{ matrix.platform.os }}-${{ matrix.platform.arch }}.${{ case(matrix.platform.os != 'windows', 'tar.gz', 'zip') }}
5454
directory: ${{ runner.temp }}/artifacts
5555
- name: Upload
5656
uses: svenstaro/upload-release-action@v2
5757
with:
5858
tag: ${{ inputs.tag }}
59-
file: ${{ runner.temp }}/hoarder-${{ matrix.platform.os }}-${{ matrix.platform.arch }}.${{ matrix.platform.os == 'windows' && 'zip' || 'tar.gz' }}
59+
file: ${{ runner.temp }}/hoarder-${{ matrix.platform.os }}-${{ matrix.platform.arch }}.${{ case(matrix.platform.os != 'windows', 'tar.gz', 'zip') }}

.github/workflows/update-schema.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Checkout repository
2525
uses: actions/checkout@v6
2626
with:
27-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
27+
ref: ${{ case(github.event_name == 'pull_request', github.event.pull_request.head.ref, '') }}
2828
- name: Set up Rust
2929
uses: actions-rust-lang/setup-rust-toolchain@v1
3030
with:

0 commit comments

Comments
 (0)