setup-forgejo/utils/upgrade-runner.sh

18 lines
688 B
Bash
Raw Normal View History

#!/bin/bash
# SPDX-License-Identifier: MIT
set -e
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
REPOSITORY="$1"
VERSION="$2"
echo $VERSION > $ROOT_DIR/RUNNER_VERSION
sed -i -e 's^| runner-version | Runner version |.*^| runner-version | Runner version | `false` | '$VERSION' |^' $ROOT_DIR/README.md
sed -i -e "/runner-version:/{n;n;s^.*default:.*^ default: '$VERSION'^}" $ROOT_DIR/action.yml
echo $REPOSITORY > $ROOT_DIR/RUNNER_REPOSITORY
sed -i -e 's^| runner | Runner git repository |.*^| runner | Runner git repository | `false` | '$REPOSITORY' |^' $ROOT_DIR/README.md
sed -i -e "/runner:/{n;n;s^.*default:.*^ default: '$REPOSITORY'^}" $ROOT_DIR/action.yml