Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): renovate-config-validator in workflow #128

Merged
merged 8 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
DerekRoberts marked this conversation as resolved.
Show resolved Hide resolved
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": []
]
}