diff --git a/.forgejo/cascading-pr-setup-forgejo b/.forgejo/cascading-pr-setup-forgejo new file mode 100755 index 0000000..8e9c59f --- /dev/null +++ b/.forgejo/cascading-pr-setup-forgejo @@ -0,0 +1,14 @@ +#!/bin/bash + +set -ex + +setup_forgejo=$1 +setup_forgejo_pr=$2 +runner_pr=$3 + +url=$(jq --raw-output .head.repo.html_url < $runner_pr) +test "$url" != null +branch=$(jq --raw-output .head.ref < $runner_pr) +test "$branch" != null +cd $setup_forgejo +./utils/upgrade-runner.sh $url @$branch diff --git a/.forgejo/workflows/cascade-setup-forgejo.yml b/.forgejo/workflows/cascade-setup-forgejo.yml new file mode 100644 index 0000000..fcfb558 --- /dev/null +++ b/.forgejo/workflows/cascade-setup-forgejo.yml @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: MIT +on: + pull_request: + 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: forgejo/runner + origin-token: ${{ secrets.CASCADING_PR_ORIGIN }} + origin-pr: ${{ github.event.pull_request.number }} + destination-url: ${{ env.GITHUB_SERVER_URL }} + destination-repo: actions/setup-forgejo + destination-branch: main + destination-token: ${{ secrets.CASCADING_PR_DESTINATION }} + update: .forgejo/cascading-pr-setup-forgejo