From c5e254427fc613a385fe62a24b3734633c457334 Mon Sep 17 00:00:00 2001 From: core23 Date: Sat, 13 Feb 2021 20:49:19 +0100 Subject: [PATCH] Fix GITHUB_REPOSITORY access --- Dockerfile | 2 +- action.yml | 11 ++++++++--- entrypoint.sh | 5 +++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index cd9162d..fdebee4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,4 +19,4 @@ ADD . /app/ RUN COMPOSER_CACHE_DIR=/dev/null composer install --no-dev --no-scripts -ENTRYPOINT ["/app/auto-merge"] +ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/action.yml b/action.yml index 2653f5d..298e6f9 100644 --- a/action.yml +++ b/action.yml @@ -9,11 +9,18 @@ branding: color: 'green' inputs: + github_token: + description: 'Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}' + required: true + repository: + description: 'Repository name to check. Default or empty value represents current github repository (${GITHUB_REPOSITORY})' + default: '' + required: false label: description: 'Label that indicates a pull request for merge.' required: false default: 'automerge' - ignore-label: + ignore_label: description: 'Label that forbids a merge.' required: false default: 'wip' @@ -24,5 +31,3 @@ inputs: runs: using: 'docker' image: 'Dockerfile' - args: - - "-l ${{ inputs.label }} -i ${{ inputs.ignore-label }} ${{ inputs.options }} ${{ inputs.GITHUB_REPOSITORY }}" diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..3cbb3d1 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY} + +GITHUB_TOKEN=${INPUT_GITHUB_TOKEN} /app/auto-merge -l ${INPUT_LABEL}} -i ${INPUT_IGNORE_LABEL} ${INPUT_OPTIONS} ${REPOSITORY}