Skip to content

Commit cb986d7

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

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ inputs:
1313

1414
runs:
1515
using: 'composite'
16+
permissions: {}
1617

1718
steps:
1819
- name: Set GitHub Path
@@ -29,11 +30,15 @@ runs:
2930
- name: Download ArkScript release
3031
shell: sh
3132
run: download.sh "${{ inputs.version }}" "${{ inputs.os }}"
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3235

3336
- name: Download latest ArkScript stdlib
3437
if: ${{ inputs.stdlib_update }} != 'no'
3538
shell: bash
3639
run: download-stdlib.sh
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3742

3843
- name: Test install
3944
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)