split out the lib

This commit is contained in:
Earl Warren 2023-10-11 18:05:11 +02:00
parent 95aee3f580
commit 5f8f262472
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
5 changed files with 508 additions and 58 deletions

View file

@ -5,20 +5,55 @@ description: |
Create and update a PR in another repository
inputs:
forgejo:
description: 'URL of the Forgejo instance where the PR is created (e.g. https://code.forgejo.org)'
origin-url:
description: 'URL of the Forgejo instance where the PR that triggers the action is located (e.g. https://code.forgejo.org)'
required: true
repo:
description: 'the repository into which the PR is created'
origin-repo:
description: 'the repository in which the PR was created'
required: true
token:
description: 'a token with write permission on repo'
origin-token:
description: 'a token with write permission on origin-repo'
required: true
destination-url:
description: 'URL of the Forgejo instance where the cascading PR is created or updated (e.g. https://code.forgejo.org)'
required: true
destination-repo:
description: 'the repository in which the cascading PR is created or updated'
required: true
destination-branch:
description: 'the base branch of the destination repository for the cascading PR'
required: true
destination-token:
description: 'a token with write permission on destination-repo'
required: true
update:
description: 'path to the script to update the content of the cascading PR'
required: true
verbose:
description: 'if true print verbose information'
default: false
debug:
description: 'if true print debug information'
default: false
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- run: |
echo
shell: bash
if "${{ inputs.verbose }}"; then
verbosity="$verbosity --verbose"
fi
if "${{ inputs.debug }}"; then
verbosity="$verbosity --debug"
fi
cascading-pr.sh $verbosity \
--origin-url "${{ inputs.origin-url }}" \
--origin-repo "${{ inputs.origin-repo }}" \
--origin-token "${{ inputs.origin-token }}" \
--destination-url "${{ inputs.destination-url }}" \
--destination-repo "${{ inputs.destination-repo }}" \
--destination-token "${{ inputs.destination-token }}" \
--destination-branch "${{ inputs.destination-branch }}" \
--update "${{ inputs.update }}"