From 51fac222bde7c5497d82d745a2351bc776a0289c Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 13 Oct 2023 14:24:19 +0200 Subject: [PATCH] install dependencies --- action.yml | 3 ++- cascading-pr-lib.sh | 7 +++++++ cascading-pr.sh | 1 + forgejo-curl.sh | 0 tests/originrepo/.forgejo/workflows/test.yml | 4 ++-- 5 files changed, 12 insertions(+), 3 deletions(-) mode change 100644 => 100755 forgejo-curl.sh diff --git a/action.yml b/action.yml index 7a4777f..dd028e0 100644 --- a/action.yml +++ b/action.yml @@ -65,4 +65,5 @@ runs: --destination-token "${{ inputs.destination-token }}" \ --destination-branch "${{ inputs.destination-branch }}" \ --update "${{ inputs.update }}" \ - --prefix "${{ inputs.prefix }}" + --prefix "${{ inputs.prefix }}" \ + run diff --git a/cascading-pr-lib.sh b/cascading-pr-lib.sh index 51b2f9f..ae112dd 100644 --- a/cascading-pr-lib.sh +++ b/cascading-pr-lib.sh @@ -16,6 +16,13 @@ DEBUG=false : ${LOOP_DELAY:=5} +function dependencies() { + if ! which jq curl > /dev/null ; then + apt-get update -qq + apt-get -qq install -y jq curl + fi +} + function debug() { DEBUG=true set -x diff --git a/cascading-pr.sh b/cascading-pr.sh index b3d6ecd..faf76cd 100755 --- a/cascading-pr.sh +++ b/cascading-pr.sh @@ -119,6 +119,7 @@ function finalize_options() { } function run() { + dependencies repo_login ${options[destination_repo]} upsert_branch upsert_pr diff --git a/forgejo-curl.sh b/forgejo-curl.sh old mode 100644 new mode 100755 diff --git a/tests/originrepo/.forgejo/workflows/test.yml b/tests/originrepo/.forgejo/workflows/test.yml index 96865fd..9b709da 100644 --- a/tests/originrepo/.forgejo/workflows/test.yml +++ b/tests/originrepo/.forgejo/workflows/test.yml @@ -14,7 +14,7 @@ jobs: origin-pr: ${{ github.event.pull_request.number }} destination-url: ${{ env.GITHUB_SERVER_URL }} destination-repo: user2/destinationrepo - destination-token: ${{ secrets.DESTINATION_TOKEN }} destination-branch: main - update: upgraded + destination-token: ${{ secrets.DESTINATION_TOKEN }} + update: ./upgraded debug: true