mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-15 16:32:36 +00:00
feat: add token input and account for Renovate WORKDIR
This commit is contained in:
parent
341841ebc6
commit
cd4dee3297
3 changed files with 23 additions and 7 deletions
5
.github/workflows/example-basic.yml
vendored
5
.github/workflows/example-basic.yml
vendored
|
|
@ -1,11 +1,11 @@
|
|||
name: Basic example
|
||||
name: Example
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
jobs:
|
||||
basic-example:
|
||||
example:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
|
@ -14,3 +14,4 @@ jobs:
|
|||
uses: ./
|
||||
with:
|
||||
configurationFile: 'test/config.js'
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,14 @@ inputs:
|
|||
description: 'Renovate configuration file'
|
||||
required: false
|
||||
default: 'src/config.js'
|
||||
token:
|
||||
description: |
|
||||
Personal access token that Renovate should use. This should be configured
|
||||
using a GitHub secret.
|
||||
required: true
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'src/Dockerfile'
|
||||
args:
|
||||
- ${{ inputs.configurationFile }}
|
||||
- ${{ inputs.token }}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
# Entrypoint for Docker.
|
||||
|
||||
readonly CONFIGURATION_FILE="${1}"
|
||||
readonly TOKEN="${2}"
|
||||
|
||||
readonly CONFIGURATION_PATH="${GITHUB_WORKSPACE}/${CONFIGURATION_FILE}"
|
||||
|
||||
if [[ ! -f "${CONFIGURATION_PATH}" ]]; then
|
||||
|
|
@ -10,12 +12,17 @@ if [[ ! -f "${CONFIGURATION_PATH}" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
cp "${CONFIGURATION_PATH}" '/usr/src/app/config.js'
|
||||
readonly WORKDIR='/usr/src/app'
|
||||
# Account for the WORKDIR entry of the renovate/renovate Docker container. See
|
||||
# the followling link for this entry.
|
||||
# https://github.com/renovatebot/renovate/blob/19.175.3/Dockerfile#L14
|
||||
cd "${WORKDIR}" || { echo "ERROR: Couldn't cd to ${WORKDIR}" 1>&2; exit 1; }
|
||||
|
||||
cp "${CONFIGURATION_PATH}" './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.
|
||||
# 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
|
||||
node /usr/src/app/dist/renovate.js
|
||||
RENOVATE_TOKEN="${TOKEN}" node /usr/src/app/dist/renovate.js
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue