Skip to content

Renovate

Renovate #759

Workflow file for this run

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Renovate
# Renovates Kroxylicious - current scope is to update container references in code.
#
# If secret `KROXYLICIOUS_GITHUB_READWRITE_TOKEN` is available, it will be used for the
# interactions. Otherwise, the action's initiator's token is used.
on:
schedule:
- cron: '0 0/9 * * 1-5'
workflow_dispatch:
jobs:
renovate:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "Calculate effective token"
env:
EFFECTIVE_TOKEN: "${{ secrets.KROXYLICIOUS_GITHUB_READWRITE_TOKEN || secrets.GITHUB_TOKEN }}"
KROXYLICIOUS_GITHUB_READWRITE_TOKEN_SET: "${{secrets.KROXYLICIOUS_GITHUB_READWRITE_TOKEN && 'true' || 'false' }}"
run: |
echo "EFFECTIVE_TOKEN=${EFFECTIVE_TOKEN}" >> $GITHUB_ENV
echo "KROXYLICIOUS_GITHUB_READWRITE_TOKEN_SET=${KROXYLICIOUS_GITHUB_READWRITE_TOKEN_SET}" >> $GITHUB_ENV
- name: "Set actor from Kroxylicious secret"
if: env.KROXYLICIOUS_GITHUB_READWRITE_TOKEN_SET == 'true'
run: |
WHOAMI=$(curl --fail --silent --proto "=https" --location \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${EFFECTIVE_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/user)
TOKEN_ACTOR=$(echo ${WHOAMI} | jq -r .name)
TOKEN_ACTOR_LOGIN=$(echo ${WHOAMI} | jq -r .login)
TOKEN_ACTOR_ID=$(echo ${WHOAMI} | jq -r .id)
echo "RENOVATE_GIT_AUTHOR=${TOKEN_ACTOR} <${TOKEN_ACTOR_ID}+${TOKEN_ACTOR_LOGIN}@users.noreply.github.com>" >> $GITHUB_ENV
- name: "Set actor from Github token"
if: env.KROXYLICIOUS_GITHUB_READWRITE_TOKEN_SET != 'true'
run: |
echo "RENOVATE_GIT_AUTHOR=${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
- name: Renovate
uses: renovatebot/github-action@5712c6a41dea6cdf32c72d92a763bd417e6606aa
with:
configurationFile: .github/renovate.json
token: ${{ env.EFFECTIVE_TOKEN }}
env:
RENOVATE_REPOSITORIES: ${{ github.repository }}
RENOVATE_ONBOARDING: "false"
LOG_LEVEL: debug