mirror of
https://code.forgejo.org/actions/cascading-pr
synced 2025-03-15 06:46:59 +01:00
create the origin repository
This commit is contained in:
parent
3da0fa91c3
commit
cdd3f46d7b
2 changed files with 7 additions and 4 deletions
1
tests/originrepo/README
Normal file
1
tests/originrepo/README
Normal file
|
@ -0,0 +1 @@
|
|||
originrepo
|
10
tests/run.sh
10
tests/run.sh
|
@ -10,7 +10,7 @@ TMPDIR=/tmp/cascading-pr
|
|||
function push_self() {
|
||||
local host_port=$1
|
||||
|
||||
forgejo-test-helper.sh push_self_action http://root:admin1234@$host_port root cascading-pr vTest
|
||||
forgejo-test-helper.sh push_self_action http://user1:admin1234@$host_port user1 cascading-pr vTest
|
||||
}
|
||||
|
||||
function user_login() {
|
||||
|
@ -33,17 +33,19 @@ function user_curl() {
|
|||
|
||||
function create_user() {
|
||||
local username="$1" email="$2"
|
||||
forgejo-curl.sh api_json -X DELETE --data-raw '{"purge":true}' ${options[url]}/api/v1/admin/users/$username >& /dev/null || true
|
||||
forgejo-curl.sh api_json -X DELETE ${options[url]}/api/v1/admin/users/$username?purge=true >& /dev/null || true
|
||||
forgejo-curl.sh api_json --data-raw '{"username":"'$username'","email":"'$email'","password":"'${options[password]}'","must_change_password":false}' ${options[url]}/api/v1/admin/users
|
||||
user_login $username
|
||||
}
|
||||
|
||||
function run() {
|
||||
push_self ${options[host_port]}
|
||||
|
||||
create_user user1 user1@example.com
|
||||
forgejo-test-helper.sh push tests/originrepo http://user1:admin1234@${options[host_port]} user1 originrepo cascading-pr
|
||||
|
||||
create_user user2 user2@example.com
|
||||
|
||||
push_self ${options[host_port]}
|
||||
|
||||
echo do something
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue