cascade end-to-end

This commit is contained in:
Earl Warren 2023-10-29 01:15:26 +02:00
parent 688d28fa41
commit 7c1b8121f7
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 46 additions and 0 deletions

View 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

View 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