Skip to content

Commit

Permalink
ci: renovate enable validation when push
Browse files Browse the repository at this point in the history
  • Loading branch information
msclock committed Mar 25, 2024
1 parent 3683e42 commit f6da426
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
# * is a special character in YAML so you have to quote this string
- cron: '*/15 0-3 * * 1'
workflow_dispatch:
push:
paths:
- .renovaterc.json
- template/.renovaterc.json

jobs:
renovate:
Expand All @@ -25,19 +29,22 @@ jobs:
steps:
- run: env | sort
- uses: actions/checkout@v4
if: github.event_name == 'push'
with:
fetch-depth: 0
- name: Validate Renovate configuration
if: github.event_name == 'push'
run: |
renovate-config-validator ${{ vars.RENOVATE_CONFIG_VALIDATOR_EXTRA_FLAGS }}
- id: generate-token
name: Generate a token with GitHub App if App ID exists
if: vars.BOT_APP_ID
if: vars.BOT_APP_ID && github.event_name != 'push'
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Run Renovate
if: github.event_name != 'push'
env:
RENOVATE_TOKEN: ${{ steps.generate-token.outputs.token || secrets.RENOVATE_TOKEN }}
RENOVATE_GIT_AUTHOR: ${{ vars.RENOVATE_GIT_AUTHOR }}
Expand Down
8 changes: 4 additions & 4 deletions .renovaterc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
{
"matchDepTypes": [
"github-runner"
"github-runner",
],
"postUpgradeTasks": {
"commands": [
Expand Down Expand Up @@ -70,11 +70,11 @@
"description": "Group renovate docker tag",
"groupName": "renovate tag",
"matchDatasources": [
"docker",
"docker"
],
"matchDepNames": [
"ghcr.io/renovatebot/renovate",
"renovate/renovate"
"ghcr.io/renovatebot/renovate",
"renovate/renovate"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
# * is a special character in YAML so you have to quote this string
- cron: '*/15 0-3 * * 1'
workflow_dispatch:
push:
paths:
- .renovaterc.json
- template/.renovaterc.json

jobs:
renovate:
Expand All @@ -25,19 +29,22 @@ jobs:
steps:
- run: env | sort
- uses: actions/checkout@v4
if: github.event_name == 'push'
with:
fetch-depth: 0
- name: Validate Renovate configuration
if: github.event_name == 'push'
run: |
renovate-config-validator {{ '${{ vars.RENOVATE_CONFIG_VALIDATOR_EXTRA_FLAGS }}' }}
- id: generate-token
name: Generate a token with GitHub App if App ID exists
if: vars.BOT_APP_ID
if: vars.BOT_APP_ID && github.event_name != 'push'
uses: actions/create-github-app-token@v1
with:
app-id: {{ '${{ vars.BOT_APP_ID }}' }}
private-key: {{ '${{ secrets.BOT_PRIVATE_KEY }}' }}
- name: Run Renovate
if: github.event_name != 'push'
env:
RENOVATE_TOKEN: {{ '${{ steps.generate-token.outputs.token || secrets.RENOVATE_TOKEN }}' }}
RENOVATE_GIT_AUTHOR: {{ '${{ vars.RENOVATE_GIT_AUTHOR }}' }}
Expand Down

0 comments on commit f6da426

Please sign in to comment.