This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
Renovate #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "Renovate" | |
on: | |
workflow_dispatch: | |
inputs: | |
dryRun: | |
description: Dry Run | |
default: "false" | |
required: false | |
logLevel: | |
description: Log Level | |
default: "debug" | |
required: false | |
version: | |
description: Renovate version | |
default: latest | |
required: false | |
schedule: | |
# Run every week on sunday and wednesday at 00:00 UTC | |
- cron: "0 0 * * 0,3" | |
push: | |
branches: ["main"] | |
paths: | |
- .github/renovate.json5 | |
- .github/renovate/**.json5 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.run_number || github.ref }} | |
cancel-in-progress: true | |
# Retrieve BOT_USER_ID via `curl -s "https://api.github.com/users/${BOT_USERNAME}%5Bbot%5D" | jq .id` | |
env: | |
WORKFLOW_DRY_RUN: false | |
WORKFLOW_LOG_LEVEL: debug | |
WORKFLOW_VERSION: latest # 37.59.8 | |
RENOVATE_PLATFORM: github | |
RENOVATE_PLATFORM_COMMIT: true | |
RENOVATE_ONBOARDING_CONFIG_FILE_NAME: .github/renovate.json5 | |
RENOVATE_AUTODISCOVER: true | |
RENOVATE_AUTODISCOVER_FILTER: "${{ github.repository }}" | |
RENOVATE_USERNAME: "${{ secrets.BOT_USERNAME }}[bot]" | |
RENOVATE_GIT_AUTHOR: "${{ secrets.BOT_USERNAME }} <${{ secrets.BOT_USER_ID }}+${{ secrets.BOT_USERNAME }}[bot]@users.noreply.github.com>" | |
jobs: | |
renovate: | |
name: Renovate | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate Token | |
uses: actions/create-github-app-token@c4fa18d55c5d49e6a2793e351ea4938322c61072 # v1.6.4 | |
id: app-token | |
with: | |
app-id: "${{ secrets.BOT_APP_ID }}" | |
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
token: "${{ steps.app-token.outputs.token }}" | |
- name: Override default config from dispatch variables | |
run: | | |
echo "RENOVATE_DRY_RUN=${{ github.event.inputs.dryRun || env.WORKFLOW_DRY_RUN }}" >> "${GITHUB_ENV}" | |
echo "LOG_LEVEL=${{ github.event.inputs.logLevel || env.WORKFLOW_LOG_LEVEL }}" >> "${GITHUB_ENV}" | |
- name: Delete old dashboard | |
run: | | |
ISSUE_NUMBER=$(gh issue list -S 'Renovate Dashboard 🤖' --json number -q '.[0].number') | |
if [ "$ISSUE_NUMBER" != "null" ] && [ -n "$ISSUE_NUMBER" ]; then | |
gh issue close "$ISSUE_NUMBER" | |
else | |
echo "No issue found to close." | |
fi | |
env: | |
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}" | |
- name: Renovate | |
uses: renovatebot/github-action@f9c81dddc9b589e4e6ae0326d1e36f6bc415d230 # v39.2.4 | |
with: | |
configurationFile: "${{ env.RENOVATE_ONBOARDING_CONFIG_FILE_NAME }}" | |
token: "${{ steps.app-token.outputs.token }}" | |
renovate-version: "${{ github.event.inputs.version || env.WORKFLOW_VERSION }}" |