mirror of
https://code.forgejo.org/actions/cascading-pr.git
synced 2025-06-27 20:33:44 +00:00
cascading-pr.sh login both repos
This commit is contained in:
parent
007e34c709
commit
71281446ea
7 changed files with 52 additions and 16 deletions
|
@ -8,11 +8,12 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
- uses: SELF@vTest
|
||||
with:
|
||||
origin-url: ${{ env.$GITHUB_SERVER_URL }}
|
||||
origin-url: ${{ env.GITHUB_SERVER_URL }}
|
||||
origin-repo: user1/originrepo
|
||||
origin-token: ${{ secrets.ORIGIN_TOKEN }}
|
||||
destination-url: ${{ env.$GITHUB_SERVER_URL }}
|
||||
destination-url: ${{ env.GITHUB_SERVER_URL }}
|
||||
destination-repo: user2/destinationrepo
|
||||
destination-token: ${{ secrets.DESTINATION_TOKEN }}
|
||||
destination-branch: main
|
||||
update: upgraded
|
||||
debug: true
|
||||
|
|
15
tests/run.sh
15
tests/run.sh
|
@ -4,13 +4,11 @@
|
|||
set -e
|
||||
|
||||
SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
TMPDIR=/tmp/cascading-pr-test
|
||||
source $SELF_DIR/../cascading-pr-lib.sh
|
||||
TMPDIR=/tmp/cascading-pr
|
||||
|
||||
function push_self() {
|
||||
local host_port=$1
|
||||
|
||||
forgejo-test-helper.sh push_self_action http://user1:admin1234@$host_port user1 cascading-pr vTest
|
||||
forgejo-test-helper.sh push_self_action http://user1:admin1234@${options[host_port]} user1 cascading-pr vTest
|
||||
}
|
||||
|
||||
function user_login() {
|
||||
|
@ -25,16 +23,13 @@ function user_login() {
|
|||
function user_curl() {
|
||||
local username=$1
|
||||
shift
|
||||
(
|
||||
export DOT=$TMPDIR/$username
|
||||
forgejo-curl.sh "$@"
|
||||
)
|
||||
DOT=$TMPDIR/$username forgejo-curl.sh "$@"
|
||||
}
|
||||
|
||||
function user_token() {
|
||||
local username=$1 name=$2
|
||||
|
||||
curl -sS -f -H Content-Type:application/json --user "$username:${options[password]}" --data-raw '{"name":"'$name'","scopes":["write:repository","write:issue"]}' ${options[url]}/api/v1/users/$username/tokens | jq --raw-output .sha1
|
||||
curl -sS -f -H Content-Type:application/json --user "$username:${options[password]}" --data-raw '{"name":"'$name'","scopes":["write:repository","write:issue"]}' ${options[url]}/api/v1/users/$username/tokens | jq --raw-output .sha1 | tee $TMPDIR/$username/token
|
||||
}
|
||||
|
||||
function user_secret() {
|
||||
|
@ -83,7 +78,7 @@ function run() {
|
|||
|
||||
create_pull_request
|
||||
|
||||
push_self ${options[host_port]}
|
||||
push_self
|
||||
|
||||
echo do something
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue