Compare commits

..

7 commits
v2.2.1 ... main

Author SHA1 Message Date
earl-warren
d0e12b7a34
Merge pull request 'feat: wait-iteration to control the timeout for the destination pull request' (#40) from earl-warren/cascading-pr:wip-wait-iteration into main
Some checks are pending
integration / integration (push) Waiting to run
Reviewed-on: https://code.forgejo.org/actions/cascading-pr/pulls/40
2025-09-11 17:17:58 +00:00
Earl Warren
c2c22e2994
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
2025-09-11 18:16:01 +02:00
Earl Warren
0ff02f5d54
docs: lxc-helper is now a dependency of the runner
Some checks failed
integration / integration (push) Has been cancelled
2025-08-21 16:24:12 +02:00
Earl Warren
8b6ed823b8
docs: lxc-helper is now a dependency of the runner 2025-08-21 16:19:59 +02:00
earl-warren
2347c83c5b
Merge pull request 'Update https://code.forgejo.org/actions/setup-forgejo action to v3.0.2' (#38) from renovate/https-code.forgejo.org-actions-setup-forgejo-3.x into main
Some checks failed
integration / integration (push) Has been cancelled
Reviewed-on: https://code.forgejo.org/actions/cascading-pr/pulls/38
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
2025-08-15 09:28:40 +00:00
Renovate Bot
add84c42ba
Update https://code.forgejo.org/actions/setup-forgejo action to v3.0.2 2025-08-15 00:04:26 +00:00
Earl Warren
fcca8ead2c
chore: act is merged in the runner source tree
Some checks failed
integration / integration (push) Has been cancelled
2025-07-28 20:33:15 +02:00
5 changed files with 20 additions and 6 deletions

View file

@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- id: forgejo - 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: with:
user: root user: root
password: admin1234 password: admin1234

View file

@ -87,8 +87,9 @@ not exist, it is created.
| destination-branch | the base branch of the destination repository for the cascading PR | `true` | | | 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` | | | 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` | | | 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` | | | 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 | | verbose | if true print verbose information | `false` | false |
| debug | if true print debug information | `false` | false | | debug | if true print debug information | `false` | false |
<!-- action-docs-inputs --> <!-- action-docs-inputs -->
@ -100,15 +101,13 @@ linked with workflows using `cascading-pr` as follows.
```mermaid ```mermaid
flowchart TD flowchart TD
lxc-helper(lxc-helper) --> act(act) lxc-helper(lxc-helper) --> runner(runner)
act --> runner(Forgejo runner)
runner --> setup-forgejo(setup-forgejo) runner --> setup-forgejo(setup-forgejo)
setup-forgejo --> e2e(end-to-end) setup-forgejo --> e2e(end-to-end)
forgejo-curl(forgejo-curl.sh) --> setup-forgejo forgejo-curl(forgejo-curl.sh) --> setup-forgejo
forgejo(forgejo) --> e2e forgejo(forgejo) --> e2e
click lxc-helper "https://code.forgejo.org/forgejo/lxc-helpers/src/branch/main/.forgejo/workflows/cascade-act.yml" click lxc-helper "https://code.forgejo.org/forgejo/lxc-helpers/src/branch/main/.forgejo/workflows/cascade-runner.yml"
click act "https://code.forgejo.org/forgejo/act/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 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 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" click e2e "https://code.forgejo.org/actions/end-to-end"

View file

@ -101,6 +101,10 @@ inputs:
update: update:
description: 'path to the script to update the content of the cascading PR' description: 'path to the script to update the content of the cascading PR'
required: true 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: prefix:
description: 'prefix of the branch from which the cascading PR is created on {destination-repo} or {destination-fork-repo} (default to {origin-repo})' description: 'prefix of the branch from which the cascading PR is created on {destination-repo} or {destination-fork-repo} (default to {origin-repo})'
close: close:
@ -143,6 +147,7 @@ runs:
--destination-token "@$destination_token" \ --destination-token "@$destination_token" \
--destination-branch "${{ inputs.destination-branch }}" \ --destination-branch "${{ inputs.destination-branch }}" \
--update "${{ inputs.update }}" \ --update "${{ inputs.update }}" \
--wait-iteration "${{ inputs.wait-iteration }}" \
--prefix "${{ inputs.prefix }}" \ --prefix "${{ inputs.prefix }}" \
--close "${{ inputs.close }}" \ --close "${{ inputs.close }}" \
run run

View file

@ -27,6 +27,10 @@ function dependencies() {
fi fi
} }
function set_loop_delay() {
LOOP_DELAY="$1"
}
function retry() { function retry() {
rm -f $TMPDIR/retry.{out,attempt,err} rm -f $TMPDIR/retry.{out,attempt,err}
local success=false local success=false

View file

@ -401,6 +401,7 @@ function finalize_options() {
else else
options[destination_is_fork]=false options[destination_is_fork]=false
fi fi
set_loop_delay ${options[wait_iteration]}
: ${options[close]:=false} : ${options[close]:=false}
} }
@ -543,6 +544,11 @@ function main() {
options[update]=$1 options[update]=$1
shift shift
;; ;;
--wait-iteration)
shift
options[wait_iteration]=$1
shift
;;
--prefix) --prefix)
shift shift
options[prefix]=$1 options[prefix]=$1