diff --git a/.github/renovate.json b/.github/renovate.json index ef1b7112..ff823f14 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -33,5 +33,14 @@ "automerge": true, "automergeType": "branch" } + ], + "regexManagers": [ + { + "fileMatch": ["\\.sh$"], + "matchStrings": [ + "# renovate: datasource=(?[a-z-]+?) depName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s[A-Z_]+?_VERSION=(?.+?)\\s" + ], + "versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}" + } ] } diff --git a/action.yml b/action.yml index a1cb6010..8e44f82a 100644 --- a/action.yml +++ b/action.yml @@ -14,9 +14,13 @@ inputs: GitHub personal access token that Renovate should use. This should be configured using a Secret. required: true +#runs: +# using: docker +# image: src/Dockerfile +# args: +# - ${{ inputs.configurationFile }} +# - ${{ inputs.token }} + runs: - using: docker - image: src/Dockerfile - args: - - ${{ inputs.configurationFile }} - - ${{ inputs.token }} + using: 'node12' + main: 'src/index.js' diff --git a/src/entrypoint.sh b/src/entrypoint.sh index 6030bcfc..d778356c 100755 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -17,4 +17,11 @@ fi # Mimic the original ENTRYPOINT of the renovate/renovate Docker container. See # the following link for this entry. # https://github.com/renovatebot/renovate/blob/19.175.3/Dockerfile#L220 -RENOVATE_TOKEN="${TOKEN}" node /usr/src/app/dist/renovate.js +#RENOVATE_TOKEN="${TOKEN}" node /usr/src/app/dist/renovate.js + +config=$(basename RENOVATE_CONFIG_FILE) + +# renovate: datasource=docker depName=renovate/renovate versioning=docker +ARG RENOVATE_VERSION=19.219.11-slim + +docker run --rm -e RENOVATE_TOKEN="${TOKEN}" -e RENOVATE_CONFIG_FILE=/$config -v /tmp:/tmp -v $RENOVATE_CONFIG_FILE:/$config renovate/renovate diff --git a/src/index.js b/src/index.js new file mode 100644 index 00000000..b432ce5d --- /dev/null +++ b/src/index.js @@ -0,0 +1,8 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { execSync } = require('child_process'); + +const cfg = process.env[`INPUT_CONFIGURATIONFILE`]; +const token = process.env[`INPUT_TOKEN`]; +const ws = process.env.GITHUB_WORKSPACE; + +execSync(`bash -c ${ws}/src/entrypoint.sh '${cfg}' '${token}'`);