v0.6.0 aba298d

install-toolcache.sh RawHistoryFolder

1#!/bin/sh
2# SPDX-License-Identifier: MIT
3# Installs the toolchains of a lock file (tool version arch sha256 url per
4# line) for the image architecture into the @actions/tool-cache layout.
5set -eu
6
7lock=${1:?usage: install-toolcache.sh LOCK_FILE}
8case "$(dpkg --print-architecture)" in
9    amd64) arch=x64 ;;
10    arm64) arch=arm64 ;;
11    *) echo 'unsupported toolcache architecture' >&2; exit 1 ;;
12esac
13cache=${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}
14tmp=$(mktemp -d)
15trap 'rm -rf "$tmp"' EXIT
16trap 'exit 130' INT TERM
17installed=0
18# The last line is read even without a final newline.
19while read -r tool version entry_arch sha url || [ -n "$tool" ]; do
20    case "$tool" in ''|'#'*) continue ;; esac
21    case "$tool" in go|node) ;; *) echo "unsupported tool: $tool" >&2; exit 1 ;; esac
22    case "$entry_arch" in x64|arm64) ;; *) echo "unsupported arch for $tool $version: $entry_arch" >&2; exit 1 ;; esac
23    [ "$entry_arch" = "$arch" ] || continue
24    case "$url" in
25        *.tar.gz) compression=z ;;
26        *.tar.xz) compression=J ;;
27        *) echo "unsupported archive: $url" >&2; exit 1 ;;
28    esac
29    curl -fsSL --retry 3 "$url" -o "$tmp/archive"
30    printf '%s  %s\n' "$sha" "$tmp/archive" | sha256sum -c -
31    dest="$cache/$tool/$version/$arch"
32    mkdir -p "$dest"
33    tar -x"$compression"f "$tmp/archive" -C "$dest" --strip-components=1 --no-same-owner
34    touch "$dest.complete"
35    rm "$tmp/archive"
36    installed=$((installed + 1))
37done < "$lock"
38if [ "$installed" -eq 0 ]; then
39    echo "no toolchain for $arch in $lock" >&2
40    exit 1
41fi
42chown -R runner:runner "$cache"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 4

Tags 11

↑↓ moveenter openesc close