mirror of
https://code.forgejo.org/actions/cascading-pr.git
synced 2025-06-30 05:43:44 +00:00
split out the lib
This commit is contained in:
parent
95aee3f580
commit
5f8f262472
5 changed files with 508 additions and 58 deletions
66
cascading-pr.sh
Normal file
66
cascading-pr.sh
Normal file
|
@ -0,0 +1,66 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
source $SELF_DIR/cascading-pr-lib.sh
|
||||
|
||||
function run() {
|
||||
options[origin_host_port]=$(host_port ${options[origin_url]})
|
||||
options[destination_host_port]=$(host_port ${options[destination_url]})
|
||||
|
||||
# login destination
|
||||
# open a PR on destination
|
||||
# checkout the head of the PR
|
||||
# update the PR
|
||||
# force-push the head
|
||||
# wait on the status of the tip of the head
|
||||
}
|
||||
|
||||
function main() {
|
||||
while true; do
|
||||
case "$1" in
|
||||
--verbose)
|
||||
shift
|
||||
verbose
|
||||
;;
|
||||
--debug)
|
||||
shift
|
||||
debug
|
||||
;;
|
||||
--origin-url)
|
||||
shift
|
||||
options[origin_url]=$1
|
||||
;;
|
||||
--origin-repo)
|
||||
shift
|
||||
options[origin_repo]=$1
|
||||
;;
|
||||
--origin-token)
|
||||
shift
|
||||
options[origin_token]=$1
|
||||
;;
|
||||
--destination-url)
|
||||
shift
|
||||
options[destination_url]=$1
|
||||
;;
|
||||
--destination-repo)
|
||||
shift
|
||||
options[destination_repo]=$1
|
||||
;;
|
||||
--destination-token)
|
||||
shift
|
||||
options[destination_token]=$1
|
||||
;;
|
||||
--update)
|
||||
shift
|
||||
options[update]=$1
|
||||
;;
|
||||
*)
|
||||
"${1:-run}"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
${MAIN:-main} "${@}"
|
Loading…
Add table
Add a link
Reference in a new issue