mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-23 22:31:04 -05:00
cascade end-to-end
This commit is contained in:
parent
688d28fa41
commit
7c1b8121f7
2 changed files with 46 additions and 0 deletions
22
.forgejo/cascading-pr-end-to-end
Executable file
22
.forgejo/cascading-pr-end-to-end
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
end_to_end=$1
|
||||
end_to_end_pr=$2
|
||||
setup_forgejo=$3
|
||||
setup_forgejo_pr=$4
|
||||
|
||||
if test "$(jq --raw-output .state < $setup_forgejo_pr)" = "closed" ; then
|
||||
echo "closed, do not update"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
url=$(jq --raw-output .head.repo.html_url < $setup_forgejo_pr)
|
||||
test "$url" != null
|
||||
branch=$(jq --raw-output .head.ref < $setup_forgejo_pr)
|
||||
test "$branch" != null
|
||||
|
||||
cd $end_to_end
|
||||
sed -i -e "s|https://code.forgejo.org/actions/setup-forgejo.*|$url@$branch|" .forgejo/workflows/actions.yml
|
||||
date > last-upgrade
|
24
.forgejo/workflows/cascade-end-to-end.yml
Normal file
24
.forgejo/workflows/cascade-end-to-end.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- closed
|
||||
jobs:
|
||||
cascade:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/cascading-pr@v1
|
||||
with:
|
||||
origin-url: ${{ env.GITHUB_SERVER_URL }}
|
||||
origin-repo: ${{ github.repository }}
|
||||
origin-token: ${{ secrets.END_TO_END_CASCADING_PR_ORIGIN }}
|
||||
origin-pr: ${{ github.event.pull_request.number }}
|
||||
destination-url: ${{ env.GITHUB_SERVER_URL }}
|
||||
destination-repo: actions/end-to-end
|
||||
destination-branch: main
|
||||
destination-token: ${{ secrets.END_TO_END_CASCADING_PR_DESTINATION }}
|
||||
close-merge: true
|
||||
update: .forgejo/cascading-pr-end-to-end
|
Loading…
Reference in a new issue