From 88f7a0781cacd522a6189e44b564df2b8c935ca1 Mon Sep 17 00:00:00 2001 From: emma Date: Mon, 23 Dec 2024 16:02:17 -0500 Subject: [PATCH] try passing github token into ruffle update --- .github/workflows/buildapp.yaml | 2 ++ ruffle/download-latest-ruffle.sh | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildapp.yaml b/.github/workflows/buildapp.yaml index 3073c910..adbe5ae0 100644 --- a/.github/workflows/buildapp.yaml +++ b/.github/workflows/buildapp.yaml @@ -34,6 +34,8 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Update Ruffle + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: yarn run update-ruffle - name: Run Build diff --git a/ruffle/download-latest-ruffle.sh b/ruffle/download-latest-ruffle.sh index b5245efc..9130a6b6 100755 --- a/ruffle/download-latest-ruffle.sh +++ b/ruffle/download-latest-ruffle.sh @@ -3,7 +3,11 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) RUFFLE_DIR=$SCRIPT_DIR -SELFHOST_URL=$(curl -s "https://api.github.com/repos/ruffle-rs/ruffle/releases" | jq -r '.[0].assets[] | select(.name | contains("selfhosted")) | .browser_download_url') +if [ -z "$GH_TOKEN" ]; then + SELFHOST_URL=$(curl -s "https://api.github.com/repos/ruffle-rs/ruffle/releases" | jq -r '.[0].assets[] | select(.name | contains("selfhosted")) | .browser_download_url') +else + SELFHOST_URL=$(curl -s --header "Authorization: Bearer $GH_TOKEN" "https://api.github.com/repos/ruffle-rs/ruffle/releases" | jq -r '.[0].assets[] | select(.name | contains("selfhosted")) | .browser_download_url') +fi echo "$SELFHOST_URL"