Skip to content

Commit a03caf5

Browse files
authored
[macos] Fix latest macos (#47)
### Summary Fixes compatibility with macos-14. macos-14 changed the location of `gtar`, this PR fixes that.
1 parent e55980d commit a03caf5

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

.github/workflows/test.yaml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ permissions:
2222

2323
jobs:
2424
test-action:
25-
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
os: [macos-12, macos-13, macos-14, macos-latest, ubuntu-latest]
28+
use-cache: [true, false]
29+
runs-on: ${{ matrix.os }}
2630
steps:
2731
- uses: actions/checkout@v4
2832
- name: Install devbox
2933
uses: ./
3034
with:
3135
project-path: 'testdata'
36+
enable-cache: ${{ matrix.use-cache }}
3237
disable-nix-access-token: "${{ github.ref != 'refs/heads/main' }}"
3338

3439
test-action-with-version:
@@ -42,17 +47,6 @@ jobs:
4247
project-path: 'testdata'
4348
disable-nix-access-token: "${{ github.ref != 'refs/heads/main' }}"
4449

45-
test-action-with-cache:
46-
runs-on: ubuntu-latest
47-
steps:
48-
- uses: actions/checkout@v4
49-
- name: Install devbox
50-
uses: ./
51-
with:
52-
enable-cache: true
53-
project-path: 'testdata'
54-
disable-nix-access-token: "${{ github.ref != 'refs/heads/main' }}"
55-
5650
test-action-with-sha256-checksum:
5751
runs-on: ubuntu-latest
5852
steps:
@@ -92,8 +86,7 @@ jobs:
9286
uses: ./
9387
with:
9488
devbox-version: 0.9.1
95-
enable-cache: true
9689
refresh-cli: true
97-
sha256-checksum: '3cf9bdffbdcc73f49f99f90df7092379589ef2e90f994cfc0163d2ff07a1f189'
90+
sha256-checksum: 'e7793acf6dadecc6a04eb64d6352665698c75f6c9f59fbe3efee3b04dbec294d'
9891
project-path: 'testdata'
9992
disable-nix-access-token: "${{ github.ref != 'refs/heads/main' }}"

action.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ runs:
106106
shell: bash
107107
run: |
108108
if [ "$RUNNER_OS" == "macOS" ]; then
109-
sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig
110-
echo "#!/bin/sh" >> /usr/local/bin/gtar
111-
echo 'exec sudo /usr/local/bin/gtar.orig "$@"' >> /usr/local/bin/gtar
112-
sudo chmod +x /usr/local/bin/gtar
109+
gtar_path=$(which gtar)
110+
sudo mv $gtar_path $gtar_path.orig
111+
echo "#!/bin/sh" >> $gtar_path
112+
echo "exec sudo $gtar_path.orig \"\$@\"" >> $gtar_path
113+
sudo chmod +x $gtar_path
113114
elif [ "$RUNNER_OS" == "Linux" ]; then
114115
mkdir -p ~/.cache
115116
mkdir -p ~/.local/bin
@@ -171,7 +172,8 @@ runs:
171172
shell: bash
172173
run: |
173174
if [ "$RUNNER_OS" == "macOS" ]; then
174-
sudo mv /usr/local/bin/gtar.orig /usr/local/bin/gtar
175+
gtar_path=$(which gtar)
176+
sudo mv $gtar_path.orig $gtar_path
175177
elif [ "$RUNNER_OS" == "Linux" ]; then
176178
rm ~/.local/bin/tar
177179
fi

0 commit comments

Comments
 (0)