Set GITHUB_TOKEN for cargo-binstall by default (#556)

Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
Taiki Endo
2024-12-04 23:02:01 +09:00
committed by GitHub
parent c4bf614c2f
commit 0139dfdb65
2 changed files with 5 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ runs:
INPUT_TOOL: ${{ inputs.tool }} INPUT_TOOL: ${{ inputs.tool }}
INPUT_CHECKSUM: ${{ inputs.checksum }} INPUT_CHECKSUM: ${{ inputs.checksum }}
INPUT_FALLBACK: ${{ inputs.fallback }} INPUT_FALLBACK: ${{ inputs.fallback }}
DEFAULT_GITHUB_TOKEN: ${{ github.token }}
if: runner.os != 'Windows' if: runner.os != 'Windows'
- run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh" - run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh"
shell: bash shell: bash
@@ -53,4 +54,5 @@ runs:
INPUT_TOOL: ${{ inputs.tool }} INPUT_TOOL: ${{ inputs.tool }}
INPUT_CHECKSUM: ${{ inputs.checksum }} INPUT_CHECKSUM: ${{ inputs.checksum }}
INPUT_FALLBACK: ${{ inputs.fallback }} INPUT_FALLBACK: ${{ inputs.fallback }}
DEFAULT_GITHUB_TOKEN: ${{ github.token }}
if: runner.os == 'Windows' if: runner.os == 'Windows'

View File

@@ -826,6 +826,9 @@ if [[ ${#unsupported_tools[@]} -gt 0 ]]; then
info "install-action does not support ${unsupported_tools[*]}; fallback to cargo-binstall" info "install-action does not support ${unsupported_tools[*]}; fallback to cargo-binstall"
IFS=$'\n\t' IFS=$'\n\t'
install_cargo_binstall 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. # By default, cargo-binstall enforce downloads over secure transports only.
# As a result, http will be disabled, and it will also set # As a result, http will be disabled, and it will also set
# min tls version to be 1.2 # min tls version to be 1.2