diff --git a/action.yml b/action.yml index 7767660c..e7f6b3d4 100644 --- a/action.yml +++ b/action.yml @@ -46,6 +46,7 @@ runs: INPUT_TOOL: ${{ inputs.tool }} INPUT_CHECKSUM: ${{ inputs.checksum }} INPUT_FALLBACK: ${{ inputs.fallback }} + DEFAULT_GITHUB_TOKEN: ${{ github.token }} if: runner.os != 'Windows' - run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh" shell: bash @@ -53,4 +54,5 @@ runs: INPUT_TOOL: ${{ inputs.tool }} INPUT_CHECKSUM: ${{ inputs.checksum }} INPUT_FALLBACK: ${{ inputs.fallback }} + DEFAULT_GITHUB_TOKEN: ${{ github.token }} if: runner.os == 'Windows' diff --git a/main.sh b/main.sh index 9bcd64ad..3768bf39 100755 --- a/main.sh +++ b/main.sh @@ -826,6 +826,9 @@ if [[ ${#unsupported_tools[@]} -gt 0 ]]; then info "install-action does not support ${unsupported_tools[*]}; fallback to cargo-binstall" IFS=$'\n\t' install_cargo_binstall + if [[ -z "${GITHUB_TOKEN:-}" ]] && [[ -n "${DEFAULT_GITHUB_TOKEN:-}" ]]; then + export GITHUB_TOKEN="${DEFAULT_GITHUB_TOKEN}" + fi # By default, cargo-binstall enforce downloads over secure transports only. # As a result, http will be disabled, and it will also set # min tls version to be 1.2