Skip to content

Commit

Permalink
chore(ci): renovate-config-validator in workflow (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Aug 20, 2024
1 parent 047fc9a commit 3698dc1
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 59 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,30 @@ concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

# Variables
env:
pr_set: '["bcgov/renovate-config", "bcgov/quickstart-openshift"]'

jobs:
Renovate:
run:
name: Dry-Run
env:
pr_set: bcgov/renovate-config bcgov/quickstart-openshift
permissions:
pull-requests: write
runs-on: ubuntu-22.04
steps:
# workflow_dispatch - optional inputs
- uses: actions/checkout@v4
- name: Config for manual workflows (optional)

# Run Renovate, dry run
- name: Renovate Dry-Run
run: |
# Process and reformat inputs.repos
IFS=', ' read -a INPUT <<< "${{ inputs.repos }}"
# Process repo list and add to config
IFS=', ' read -a INPUT <<< "${{ inputs.repos || env.pr_set }}"
for r in "${INPUT[@]}"; do
REPOS+="\"$r\","
done
REPOS=${REPOS%,*}
# Set target repos
cat <<< $(jq '. | .repositories = ['${REPOS}']' renovate.json) > renovate.json
cat renovate.json | jq .repositories
# PRs - dry run and a small number of repos
- name: Config for pull requests
if: github.event_name == 'pull_request'
run: |
# Dry run and short repo list
# Dry run
cat <<< $(jq '.+= {"dryRun": "full"}' renovate.json) > renovate.json
cat <<< $(jq '. | .repositories = ${{ env.pr_set }}' renovate.json) > renovate.json
cat renovate.json | jq .repositories
# Run Renovate
- name: Run Renovate
Expand All @@ -65,3 +56,15 @@ jobs:
with:
configurationFile: renovate.json
token: ${{ secrets.RENOVATE_TOKEN }}

validate:
name: Validate
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'

- name: Validate Config
run: npx --yes --package renovate --- "renovate-config-validator --strict default.json renovate.json"
70 changes: 32 additions & 38 deletions default.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"automerge": true,
"configMigration": true,
"dependencyDashboard": true,
"description": "Default preset for use with Renovate's repos",
"extends": [
"config:recommended",
Expand All @@ -26,18 +29,31 @@
":semanticCommitScope(deps)"
],
"forkProcessing": "enabled",
"onboarding": true,
"platform": "github",
"configMigration": true,
"dependencyDashboard": true,
"automerge": true,
"automergeType": "pr",
"platformAutomerge": true,
"prCreation": "not-pending",
"rebaseWhen": "behind-base-branch",
"ignorePresets": [
":ignoreModulesAndTests"
],
"minimumReleaseAge": "3 days",
"prConcurrentLimit": 5,
"onboarding": true,
"packageRules": [
{
"groupName": "github actions all dependencies",
"groupSlug": "github actions all",
"matchManagers": [
"github-actions"
],
"matchUpdateTypes": [
"major",
"minor",
"patch",
"pin",
"pinDigest",
"digest",
"lockFileMaintenance",
"rollback",
"bump",
"replacement"
]
},
{
"description": "Py - group boto",
"groupName": "boto",
Expand Down Expand Up @@ -132,35 +148,16 @@
]
},
{
"groupName": "maven all non-major dependencies",
"groupSlug": "maven all-minor-patch",
"matchManagers": [
"maven"
],
"matchUpdateTypes": [
"minor",
"patch",
"lockFileMaintenance"
],
"groupName": "maven all non-major dependencies",
"groupSlug": "maven all-minor-patch"
},
{
"matchManagers": [
"github-actions"
],
"matchUpdateTypes": [
"major",
"minor",
"patch",
"pin",
"pinDigest",
"digest",
"lockFileMaintenance",
"rollback",
"bump",
"replacement"
],
"groupName": "github actions all dependencies",
"groupSlug": "github actions all"
]
},
{
"description": "JS - block eslint9",
Expand All @@ -174,10 +171,7 @@
]
}
],
"ignorePresets": [
":ignoreModulesAndTests"
],
"pre-commit": {
"pinDigests": false
}
"platform": "github",
"platformAutomerge": true,
"prConcurrentLimit": 5
}
3 changes: 1 addition & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"description": "Default preset for use with Renovate's repos",
"extends": [
"github>bcgov/renovate-config"
],
"repositories": []
]
}

0 comments on commit 3698dc1

Please sign in to comment.