Skip to content

Commit

Permalink
Use renovate to test new versions of requests and pydantic without me…
Browse files Browse the repository at this point in the history
…rging verison changes to main (#73)

* chore: Add pre-commit hook for renovate config validation

* chore: Update renovate.json with new package update configurations

* chore: Add workflow to close Renovate PRs on success
  • Loading branch information
mnbf9rca authored Aug 15, 2024
1 parent 9f82b91 commit 97cbf90
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test_close_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Close Renovate PRs on Success

on:
workflow_run:
workflows: ["Run Tests"]
types:
- completed

jobs:
close_pr:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Close PR if tests pass and label exists
run: |
PR_NUMBER=$(jq -r '.pull_requests[0].number' < "${{ github.event.workflow_run.pull_requests }}")
LABELS=$(gh pr view $PR_NUMBER --json labels --jq '.labels[].name')
if [[ "$LABELS" == *"renovate-pydantic-requests"* ]]; then
gh pr close $PR_NUMBER --delete-branch
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 38.27.1
hooks:
- id: renovate-config-validator
165 changes: 164 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pytest-cov = "^5.0.0"
flake8 = "^7.1.0"
Flake8-pyproject = "^1.2.3"
coverage = {extras = ["toml"], version = "^7.5.4"}
pre-commit = "^3.8.0"

[build-system]
requires = ["poetry-core"]
Expand Down
15 changes: 14 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,25 @@
"vulnerabilityAlerts": true,
"matchUpdateTypes": ["patch", "minor", "major"],
"automerge": true
},
{
"matchManagers": ["dockerfile", "github-actions"],
"pinDigests": false
},
{
"matchPackageNames": ["pydantic", "requests"],
"rangeStrategy": "bump",
"automerge": false,
"separateMinorPatch": true,
"labels": ["renovate-pydantic-requests"],
"commitMessageAction": "Test update",
"commitMessageTopic": "{{depName}}",
"commitMessageExtra": "to {{newVersion}}"
}
],
"lockFileMaintenance": {
"enabled": false
},
"rebaseWhen": "behind-base-branch",
"updateNotScheduled": true

}

0 comments on commit 97cbf90

Please sign in to comment.