From 9efc297f1fa2e481107b4436b131f36c119078c5 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 15 Oct 2023 16:37:51 +0000 Subject: [PATCH] [FORGEJO] workflow cascading-pr to setup-forgejo (#93) Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/93 Reviewed-by: dachary Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/cascading-pr-setup-forgejo | 14 ++++++++++++ .forgejo/workflows/cascade-setup-forgejo.yml | 23 ++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 .forgejo/cascading-pr-setup-forgejo create mode 100644 .forgejo/workflows/cascade-setup-forgejo.yml 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