Skip to content

Commit

Permalink
Use GITHUB_OUTPUT to share variables across steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Hurlenko committed Nov 4, 2023
1 parent 4ad1f4e commit ed88344
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
sudo apt-get update && sudo apt-get install jq -y
THIS_REPO=https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest
TARGET_REPO=https://api.github.com/repos/filebrowser/filebrowser/releases/latest
echo "current=$(curl $THIS_REPO | jq -r '.tag_name')" >> $GITHUB_STATE
echo "target=$(curl $TARGET_REPO | jq -r '.tag_name')" >> $GITHUB_STATE
echo "current=$(curl $THIS_REPO | jq -r '.tag_name')" >> $GITHUB_OUTPUT
echo "target=$(curl $TARGET_REPO | jq -r '.tag_name')" >> $GITHUB_OUTPUT
id: releases

- name: Install Docker CE
Expand Down
24 changes: 13 additions & 11 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# This script installs File Browser to your path.
# Usage:
#
# $ curl -fsSL https://filebrowser.xyz/get.sh | bash
# $ curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
# or
# $ wget -qO- https://filebrowser.xyz/get.sh | bash
# $ wget -qO- https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
#
# In automated environments, you may want to run as root.
# If using curl, we recommend using the -fsSL flags.
Expand Down Expand Up @@ -97,22 +97,24 @@ install_filemanager()
########################

echo "Downloading File Browser for $filemanager_os/$filemanager_arch..."
if type -p curl >/dev/null 2>&1; then
net_getter="curl -fsSL"
elif type -p wget >/dev/null 2>&1; then
net_getter="wget -qO-"
else
echo "Aborted, could not find curl or wget"
return 7
fi

filemanager_file="${filemanager_os}-$filemanager_arch-filebrowser$filemanager_dl_ext"
# filemanager_tag="$(curl -s https://api.github.com/repos/filebrowser/filebrowser/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g' | sed 's/tag_name: //g')"
# filemanager_tag="$(${net_getter} https://api.github.com/repos/filebrowser/filebrowser/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g' | sed 's/tag_name: //g')"
filemanager_url="https://github.com/filebrowser/filebrowser/releases/download/$filemanager_tag/$filemanager_file"
echo "$filemanager_url"

# Use $PREFIX for compatibility with Termux on Android
rm -rf "$PREFIX/tmp/$filemanager_file"

if type -p curl >/dev/null 2>&1; then
curl -fsSL "$filemanager_url" -o "$PREFIX/tmp/$filemanager_file"
elif type -p wget >/dev/null 2>&1; then
wget --quiet "$filemanager_url" -O "$PREFIX/tmp/$filemanager_file"
else
echo "Aborted, could not find curl or wget"
return 7
fi
${net_getter} "$filemanager_url" > "$PREFIX/tmp/$filemanager_file"

echo "Extracting..."
case "$filemanager_file" in
Expand Down

0 comments on commit ed88344

Please sign in to comment.