summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Warren <contact@earl-warren.org>2023-11-04 19:14:39 +0100
committerEarl Warren <contact@earl-warren.org>2024-03-11 09:30:55 +0100
commit8c59ad2ab35aa1680917c261e0be7f1678e3ebca (patch)
treeb0139d73323d727ce46b289690e98e209efc8683
parent[FORGEJO] add unit tests (diff)
downloadforgejo-act-8c59ad2ab35aa1680917c261e0be7f1678e3ebca.tar.xz
forgejo-act-8c59ad2ab35aa1680917c261e0be7f1678e3ebca.zip
[FORGEJO] cascading PR to runner
-rwxr-xr-x.forgejo/cascading-pr-runner18
-rw-r--r--.forgejo/workflows/cascade-runner.yml30
-rw-r--r--README.md2
3 files changed, 49 insertions, 1 deletions
diff --git a/.forgejo/cascading-pr-runner b/.forgejo/cascading-pr-runner
new file mode 100755
index 0000000..bcb29c6
--- /dev/null
+++ b/.forgejo/cascading-pr-runner
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -ex
+
+runner=$1
+runner_pr=$2
+act=$3
+act_pr=$4
+
+url=$(jq --raw-output .head.repo.html_url < $act_pr)
+test "$url" != null
+url=${url##http*://}
+branch=$(jq --raw-output .head.ref < $act_pr)
+test "$branch" != null
+cd $runner
+sed -i -e "s|^replace github.com/nektos/act.*|replace github.com/nektos/act => $url $branch|" go.mod
+GOPROXY=direct go mod tidy
+date > last-upgrade
diff --git a/.forgejo/workflows/cascade-runner.yml b/.forgejo/workflows/cascade-runner.yml
new file mode 100644
index 0000000..6ee43ca
--- /dev/null
+++ b/.forgejo/workflows/cascade-runner.yml
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: MIT
+on:
+ pull_request_target:
+ types:
+ - opened
+ - synchronize
+ - closed
+jobs:
+ cascade:
+ runs-on: docker
+ if: vars.CASCADE != 'no'
+ container:
+ image: 'docker.io/node:20-bookworm'
+ steps:
+ - uses: https://code.forgejo.org/actions/setup-go@v4
+ with:
+ go-version: "1.21"
+ - uses: actions/cascading-pr@v1
+ with:
+ origin-url: ${{ env.GITHUB_SERVER_URL }}
+ origin-repo: forgejo/act
+ origin-token: ${{ secrets.CASCADING_PR_ORIGIN }}
+ origin-pr: ${{ github.event.pull_request.number }}
+ destination-url: ${{ env.GITHUB_SERVER_URL }}
+ destination-repo: forgejo/runner
+ destination-fork-repo: cascading-pr/runner
+ destination-branch: main
+ destination-token: ${{ secrets.CASCADING_PR_DESTINATION }}
+ close-merge: true
+ update: .forgejo/cascading-pr-runner
diff --git a/README.md b/README.md
index 99e898e..b74d63a 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
## Forking rules
-This is a custom fork of [nektos/act](https://github.com/nektos/act/), for the purpose of serving [act_runner](https://gitea.com/gitea/act_runner).
+This is a custom fork of [nektos/act](https://github.com/nektos/act/), for the [Forgejo runner](https://code.forgejo.org/forgejo/runner).
It cannot be used as command line tool anymore, but only as a library.