Skip to content

Commit 508a05a

Browse files
committed
feat(ci): use github token for curl calls
1 parent 3365090 commit 508a05a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

action.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ runs:
2929
- name: Download ArkScript release
3030
shell: sh
3131
run: download.sh "${{ inputs.version }}" "${{ inputs.os }}"
32+
env:
33+
GITHUB_TOKEN: ${{ github.token }}
3234

3335
- name: Download latest ArkScript stdlib
3436
if: ${{ inputs.stdlib_update }} != 'no'
3537
shell: bash
3638
run: download-stdlib.sh
39+
env:
40+
GITHUB_TOKEN: ${{ github.token }}
3741

3842
- name: Test install
3943
shell: bash

download-stdlib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
curl https://github.com/ArkScript-lang/std/archive/refs/heads/master.zip -O -J -L
3+
curl -H "Authorization: token $GITHUB_TOKEN" https://github.com/ArkScript-lang/std/archive/refs/heads/master.zip -O -J -L
44
unzip -oq std-master.zip "std-master/*.ark" -x "std-master/tests/*"
55

66
rm std-master.zip

download.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ if [[ "$VERSION" != "latest" ]]; then
2626
URL="https://api.github.com/repos/ArkScript-lang/Ark/releases/tags/$VERSION"
2727
fi
2828

29-
API_OUTPUT=$(curl -s "$URL")
29+
API_OUTPUT=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$URL")
3030
if [[ $(echo -ne "$API_OUTPUT" | grep "status.*404") != "" ]]; then
3131
echo "Release '$VERSION' not found"
3232
exit 1
3333
fi
3434

3535
ASSET_PATH=$(echo -ne "$API_OUTPUT" | grep "browser_download_url.*${ASSET}.zip" | cut -d : -f 2,3 | tr -d \" | tr -d " ")
36-
curl "$ASSET_PATH" -O -J -L
36+
curl -H "Authorization: token $GITHUB_TOKEN" "$ASSET_PATH" -O -J -L
3737

3838
mkdir -p .arkscript
3939
unzip -oq "${ASSET}.zip" -d .arkscript

0 commit comments

Comments
 (0)