@@ -13,38 +13,39 @@ inputs:
13
13
runs :
14
14
using : composite
15
15
steps :
16
- - name : Build path list
17
- id : brew_paths
16
+ - name : Build path list and check brew version
17
+ id : brew
18
18
shell : bash
19
19
run : |
20
- P ="${{ steps.brew_env.outputs. prefix }} "
20
+ prefix ="$(brew -- prefix) "
21
21
{
22
22
echo 'list<<EOF'
23
23
printf '%s\n' \
24
- "$P /bin" "$P /etc" "$P /include" "$P /lib" "$P /opt" \
25
- "$P /sbin" "$P /share" "$P /var" "$P /Library/Taps"
24
+ "$prefix /bin" "$prefix /etc" "$prefix /include" "$prefix /lib" "$prefix /opt" \
25
+ "$prefix /sbin" "$prefix /share" "$prefix /var" "$prefix /Library/Taps"
26
26
echo 'EOF'
27
27
} >>"$GITHUB_OUTPUT"
28
+ version=$(brew --version)
28
29
- name : Cache lookup
29
30
id : cache_lookup
30
31
uses : actions/cache/restore@v4
31
32
with :
32
33
lookup-only : true
33
- path : ${{ steps.brew_paths .outputs.list }}
34
- key : brew-pristine-${{ inputs.os }}-${{ steps.brew_env .outputs.version }}
34
+ path : ${{ steps.brew .outputs.list }}
35
+ key : brew-pristine-${{ inputs.os }}-${{ steps.brew .outputs.version }}
35
36
- name : Remove current Homebrew directories
36
37
if : inputs.restore == 'true' && steps.cache_lookup.outputs.cache-hit == 'true'
37
38
shell : bash
38
39
run : |
39
40
while read -r d; do
40
41
rm -rf "$d"
41
- done <<<"${{ steps.brew_paths .outputs.list }}"
42
+ done <<<"${{ steps.brew .outputs.list }}"
42
43
- name : Restore pristine Homebrew
43
44
id : cache_restore
44
45
if : inputs.restore == 'true' && steps.cache_lookup.outputs.cache-hit == 'true'
45
46
uses : actions/cache/restore@v4
46
47
with :
47
- path : ${{ steps.brew_paths .outputs.list }}
48
+ path : ${{ steps.brew .outputs.list }}
48
49
key : ${{ steps.cache_lookup.outputs.cache-primary-key }}
49
50
- name : Make Homebrew pristine
50
51
if : steps.cache_lookup.outputs.cache-hit != 'true'
79
80
if : steps.cache_lookup.outputs.cache-hit != 'true'
80
81
uses : actions/cache/save@v4
81
82
with :
82
- path : ${{ steps.brew_paths .outputs.list }}
83
- key : brew-pristine-${{ inputs.os }}-${{ steps.brew_env .outputs.version }}
83
+ path : ${{ steps.brew .outputs.list }}
84
+ key : brew-pristine-${{ inputs.os }}-${{ steps.brew .outputs.version }}
84
85
- name : Remove brew download cache
85
86
if : inputs.restore == 'true'
86
87
shell : bash
0 commit comments