From 7fd097520864c933bfc3281aff3da82a722e3cb3 Mon Sep 17 00:00:00 2001 From: Yeasin Ar Rahman Date: Thu, 9 Jul 2020 11:36:23 +0600 Subject: [PATCH 1/4] adapted code for monorepo --- README.md | 9 +++++++++ action.yml | 4 ++++ entrypoint.sh | 13 +++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7002793..2880158 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,12 @@ uses: wtag/pronto-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} ``` + +### MonoRepo + +```yaml +uses: wtag/pronto-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + code_directory: ferryhub-core +``` diff --git a/action.yml b/action.yml index 3545db3..c31699f 100644 --- a/action.yml +++ b/action.yml @@ -4,8 +4,12 @@ inputs: github_token: description: 'Token to use for reporting' required: true + code_directory: + description: 'ruby code directory in monorepo' + required: false runs: using: 'docker' image: 'docker://welltravel/pronto-action:latest' args: - ${{ inputs.github_token }} + - ${{ inputs.code_directory }} diff --git a/entrypoint.sh b/entrypoint.sh index f7fdbaa..3060cfd 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,6 +3,7 @@ set -eo pipefail export PRONTO_GITHUB_ACCESS_TOKEN="${1}" +export BASE_FOLDER="${2}" SHA=$(jq --raw-output .head_commit.id "${GITHUB_EVENT_PATH}") OWNER=$(jq --raw-output .repository.owner.name "${GITHUB_EVENT_PATH}") @@ -19,6 +20,14 @@ fi git fetch --unshallow -for PULL_ID in $PULL_IDS; do +if [ -z "${BASE_FOLDER}" ]; then + for PULL_ID in $PULL_IDS; do PRONTO_PULL_REQUEST_ID=$PULL_ID /usr/local/bundle/bin/pronto run -f github_status github_pr -c origin/master -done + done +else + cd ${BASE_FOLDER} + for PULL_ID in $PULL_IDS; do + PRONTO_PULL_REQUEST_ID=$PULL_ID /usr/local/bundle/bin/pronto run -f github_status github_pr -c origin/master + done +fi + From 93bfc811942c6b0a9bcae6d1acc9bd7efa47c7b2 Mon Sep 17 00:00:00 2001 From: Yeasin Ar Rahman <32414212+yra-wtag@users.noreply.github.com> Date: Thu, 9 Jul 2020 02:20:09 -0700 Subject: [PATCH 2/4] Update action.yml Co-authored-by: Raffael Schmid --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c31699f..636643b 100644 --- a/action.yml +++ b/action.yml @@ -5,7 +5,7 @@ inputs: description: 'Token to use for reporting' required: true code_directory: - description: 'ruby code directory in monorepo' + description: 'path to code directory' required: false runs: using: 'docker' From 479e8cb02c089388a1a50fde68637bdb92428c5e Mon Sep 17 00:00:00 2001 From: Yeasin Ar Rahman Date: Thu, 9 Jul 2020 15:21:05 +0600 Subject: [PATCH 3/4] Update entrypoint.sh --- entrypoint.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3060cfd..6d92f50 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,14 +20,11 @@ fi git fetch --unshallow -if [ -z "${BASE_FOLDER}" ]; then - for PULL_ID in $PULL_IDS; do - PRONTO_PULL_REQUEST_ID=$PULL_ID /usr/local/bundle/bin/pronto run -f github_status github_pr -c origin/master - done -else +if [ ! -z "${BASE_FOLDER}" ]; then cd ${BASE_FOLDER} - for PULL_ID in $PULL_IDS; do - PRONTO_PULL_REQUEST_ID=$PULL_ID /usr/local/bundle/bin/pronto run -f github_status github_pr -c origin/master - done fi +for PULL_ID in $PULL_IDS; do + PRONTO_PULL_REQUEST_ID=$PULL_ID /usr/local/bundle/bin/pronto run -f github_status github_pr -c origin/master +done + From 6eba4f003a6b3390df9e71e708c56be2fe405acb Mon Sep 17 00:00:00 2001 From: Yeasin Ar Rahman Date: Thu, 9 Jul 2020 15:23:15 +0600 Subject: [PATCH 4/4] Update entrypoint.sh --- entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6d92f50..f8be55b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,4 +27,3 @@ fi for PULL_ID in $PULL_IDS; do PRONTO_PULL_REQUEST_ID=$PULL_ID /usr/local/bundle/bin/pronto run -f github_status github_pr -c origin/master done -