mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-12-25 22:32:12 -05:00
Merge pull request 'cascade end-to-end' (#76) from earl-warren/setup-forgejo:wip-cascade-end-to-end into main
Reviewed-on: https://code.forgejo.org/actions/setup-forgejo/pulls/76 Reviewed-by: dachary <dachary@noreply.code.forgejo.org>
This commit is contained in:
commit
6e64c34d26
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