Skip to content

Commit 2c3b83e

Browse files
committed
Update action.yml
1 parent 20ab3fe commit 2c3b83e

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

action.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ runs:
1717
1818
VERSION="${{ inputs.version }}"
1919
if [ "$VERSION" = 'latest' ]; then
20-
VERSION=$(curl -sSfL \
21-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
22-
"https://api.github.com/repos/WebAssembly/binaryen/releases/latest" \
23-
| jq -r '.tag_name')
20+
VERSION=$(gh release view \
21+
--repo WebAssembly/binaryen \
22+
--json tagName -q .tagName)
2423
fi
2524
echo "Version: $VERSION"
2625
@@ -50,16 +49,16 @@ runs:
5049
fi
5150
echo "Test: $ASSET"
5251
53-
ASSET=$(curl -sSfL \
54-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
55-
"https://api.github.com/repos/WebAssembly/binaryen/releases/tags/$VERSION" \
56-
| jq -r ".assets[].name | select(test(\"$ASSET\"))")
52+
ASSET=$(gh release view $VERSION \
53+
--repo WebAssembly/binaryen \
54+
--json assets -q ".assets[].name | select(test(\"$ASSET\"))")
5755
echo "Asset: $ASSET"
5856
5957
mkdir binaryen
60-
curl -sSfL \
61-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
62-
"https://github.com/WebAssembly/binaryen/releases/download/$VERSION/$ASSET" \
58+
gh release download $VERSION \
59+
--repo WebAssembly/binaryen \
60+
--pattern $ASSET \
61+
-O - \
6362
| tar -xzC binaryen --strip-components=1
6463
ls binaryen/bin
6564
echo "$(pwd -W 2>/dev/null || pwd)/binaryen/bin" >> $GITHUB_PATH

0 commit comments

Comments
 (0)