diff --git a/.github/workflows/example-basic.yml b/.github/workflows/example-basic.yml index 63c96dc6..f19f3704 100644 --- a/.github/workflows/example-basic.yml +++ b/.github/workflows/example-basic.yml @@ -7,15 +7,9 @@ on: jobs: basic-example: runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: ls - run: npm ci - name: Renovate uses: ./ with: diff --git a/action.yml b/action.yml index 2606747c..98a711bf 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,4 @@ inputs: default: 'src/config.js' runs: using: 'docker' - image: 'src/dockerfile' - args: - - ${{ inputs.configurationFile }} + image: 'src/Dockerfile' diff --git a/src/Dockerfile b/src/Dockerfile new file mode 100644 index 00000000..3b19afa5 --- /dev/null +++ b/src/Dockerfile @@ -0,0 +1,5 @@ +FROM renovate/renovate:19.175.0 + +COPY src/entrypoint.sh /usr/entrypoint.sh + +ENTRYPOINT ["/usr/entrypoint.sh"] diff --git a/src/dockerfile b/src/dockerfile deleted file mode 100644 index 4168d76a..00000000 --- a/src/dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM renovate/renovate:19.175.0 - -COPY entrypoint.sh /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/entrypoint.sh b/src/entrypoint.sh index e70def06..74e5f2b8 100755 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -2,9 +2,20 @@ # # Entrypoint for Docker. -configurationFile="${1}" +readonly CONFIGURATION_FILE="${1}" +readonly CONFIGURATION_PATH="${GITHUB_WORKSPACE}/${CONFIGURATION_FILE}" -cp "${GITHUB_WORKSPACE}/${configurationFile}" '/usr/src/app/config.js' +if [[ ! -f "${CONFIGURATION_PATH}" ]]; then + echo "ERROR: Couldn't find file ${CONFIGURATION_PATH}" 1>&2 + exit 1 +fi + +cp "${CONFIGURATION_PATH}" '/usr/src/app/config.js' # Run Renovate. +# +# This mimics the original entrypoint of the renovate/renovate Docker container. +# See the following link for this entrypoint in the renovate/renovate Docker +# container. +# https://github.com/renovatebot/renovate/blob/19.175.3/Dockerfile#L220 node /usr/src/app/dist/renovate.js