From fcca8ead2c2a8527e92c0feda3f05b965b5ca84c Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 28 Jul 2025 20:33:15 +0200 Subject: [PATCH 1/5] chore: act is merged in the runner source tree --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 1267e85..bf90542 100644 --- a/README.md +++ b/README.md @@ -101,14 +101,12 @@ linked with workflows using `cascading-pr` as follows. ```mermaid flowchart TD lxc-helper(lxc-helper) --> act(act) - act --> runner(Forgejo runner) runner --> setup-forgejo(setup-forgejo) setup-forgejo --> e2e(end-to-end) forgejo-curl(forgejo-curl.sh) --> setup-forgejo forgejo(forgejo) --> e2e - click lxc-helper "https://code.forgejo.org/forgejo/lxc-helpers/src/branch/main/.forgejo/workflows/cascade-act.yml" - click act "https://code.forgejo.org/forgejo/act/src/branch/main/.forgejo/workflows/cascade-runner.yml" + click lxc-helper "https://code.forgejo.org/forgejo/lxc-helpers/src/branch/main/.forgejo/workflows/cascade-runner.yml" click runner "https://code.forgejo.org/forgejo/runner/src/branch/main/.forgejo/workflows/cascade-setup-forgejo.yml" click setup-forgejo "https://code.forgejo.org/actions/setup-forgejo/src/branch/main/.forgejo/workflows/cascade-end-to-end.yml" click e2e "https://code.forgejo.org/actions/end-to-end" From add84c42bab9be90e2578ab647395bb5961432fd Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 15 Aug 2025 00:04:26 +0000 Subject: [PATCH 2/5] Update https://code.forgejo.org/actions/setup-forgejo action to v3.0.2 --- .forgejo/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/integration.yml b/.forgejo/workflows/integration.yml index 36fa2d0..1e61660 100644 --- a/.forgejo/workflows/integration.yml +++ b/.forgejo/workflows/integration.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - id: forgejo - uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.1 + uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.2 with: user: root password: admin1234 From 8b6ed823b836aa549f901bed7533f9dbd336139d Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 21 Aug 2025 16:19:13 +0200 Subject: [PATCH 3/5] docs: lxc-helper is now a dependency of the runner --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf90542..4f3a126 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ linked with workflows using `cascading-pr` as follows. ```mermaid flowchart TD - lxc-helper(lxc-helper) --> act(act) + lxc-helper(lxc-helper) --> act(runner) runner --> setup-forgejo(setup-forgejo) setup-forgejo --> e2e(end-to-end) forgejo-curl(forgejo-curl.sh) --> setup-forgejo From 0ff02f5d54e1009b7c4260aff25be17460175b08 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 21 Aug 2025 16:24:12 +0200 Subject: [PATCH 4/5] docs: lxc-helper is now a dependency of the runner --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f3a126..c3c6a5d 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ linked with workflows using `cascading-pr` as follows. ```mermaid flowchart TD - lxc-helper(lxc-helper) --> act(runner) + lxc-helper(lxc-helper) --> runner(runner) runner --> setup-forgejo(setup-forgejo) setup-forgejo --> e2e(end-to-end) forgejo-curl(forgejo-curl.sh) --> setup-forgejo From c2c22e2994c898f328644ecd47c645e3e9c4bc60 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 11 Sep 2025 18:14:06 +0200 Subject: [PATCH 5/5] feat: wait-iteration to control the timeout for the destination pull request on a busy repository or with a long workflow, it may take more than the one hour default to complete --- README.md | 3 ++- action.yml | 5 +++++ cascading-pr-lib.sh | 4 ++++ cascading-pr.sh | 6 ++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c3c6a5d..1c4b957 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,9 @@ not exist, it is created. | destination-branch | the base branch of the destination repository for the cascading PR | `true` | | | destination-token | a token with write permission on destination-repo | `true` | | | update | path to the script to update the content of the cascading PR | `true` | | +| wait-iteration | number of seconds to wait before verifying for the status of the destination pull request (timeout after 100 iterations) | `true` | 36 | | prefix | prefix of the branch from which the cascading PR is created on {destination-repo} or {destination-fork-repo} (default to {origin-repo}) | `false` | | -| close | if true the cascading PR will be closed and the branch deleted when the PR is merged | `false` | false | +| close | if true the cascading PR will be closed and the branch deleted when (i) the {origin-pr} is merged or (ii) when the cascading PR status is success if {origin-ref} is set | `false` | false | | verbose | if true print verbose information | `false` | false | | debug | if true print debug information | `false` | false | diff --git a/action.yml b/action.yml index 755770d..6734afe 100644 --- a/action.yml +++ b/action.yml @@ -101,6 +101,10 @@ inputs: update: description: 'path to the script to update the content of the cascading PR' required: true + wait-iteration: + description: 'number of seconds to wait before verifying for the status of the destination pull request (timeout after 100 iterations)' + default: 36 + required: true prefix: description: 'prefix of the branch from which the cascading PR is created on {destination-repo} or {destination-fork-repo} (default to {origin-repo})' close: @@ -143,6 +147,7 @@ runs: --destination-token "@$destination_token" \ --destination-branch "${{ inputs.destination-branch }}" \ --update "${{ inputs.update }}" \ + --wait-iteration "${{ inputs.wait-iteration }}" \ --prefix "${{ inputs.prefix }}" \ --close "${{ inputs.close }}" \ run diff --git a/cascading-pr-lib.sh b/cascading-pr-lib.sh index 06f3dad..4ad2c42 100644 --- a/cascading-pr-lib.sh +++ b/cascading-pr-lib.sh @@ -27,6 +27,10 @@ function dependencies() { fi } +function set_loop_delay() { + LOOP_DELAY="$1" +} + function retry() { rm -f $TMPDIR/retry.{out,attempt,err} local success=false diff --git a/cascading-pr.sh b/cascading-pr.sh index 99f3c81..f6aa74c 100755 --- a/cascading-pr.sh +++ b/cascading-pr.sh @@ -401,6 +401,7 @@ function finalize_options() { else options[destination_is_fork]=false fi + set_loop_delay ${options[wait_iteration]} : ${options[close]:=false} } @@ -543,6 +544,11 @@ function main() { options[update]=$1 shift ;; + --wait-iteration) + shift + options[wait_iteration]=$1 + shift + ;; --prefix) shift options[prefix]=$1