mirror of
https://code.forgejo.org/actions/cascading-pr.git
synced 2025-04-22 16:50:50 +00:00
55 lines
867 B
Bash
Executable file
55 lines
867 B
Bash
Executable file
#!/bin/bash
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
source $SELF_DIR/../cascading-pr-lib.sh
|
|
|
|
function push_self() {
|
|
local host_port=$1
|
|
|
|
forgejo-test-helper.sh push_self_action http://root:admin1234@$host_port root cascading-pr vTest
|
|
}
|
|
|
|
function run() {
|
|
push_self ${options[host_port]}
|
|
|
|
echo do something
|
|
}
|
|
|
|
function main() {
|
|
local command=run
|
|
options[host_port]=$(cat forgejo-ip):3000
|
|
options[url]=http://$host_port
|
|
options[token]=$(cat forgejo-token)
|
|
|
|
while true; do
|
|
case "$1" in
|
|
--verbose)
|
|
shift
|
|
verbose
|
|
;;
|
|
--debug)
|
|
shift
|
|
debug
|
|
;;
|
|
--host_port)
|
|
shift
|
|
options[host_port]=$1
|
|
;;
|
|
--url)
|
|
shift
|
|
options[url]=$1
|
|
;;
|
|
--token)
|
|
shift
|
|
options[token]=$1
|
|
;;
|
|
*)
|
|
"${1:-run}"
|
|
return 0
|
|
;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
${MAIN:-main} "${@}"
|