mirror of
https://github.com/renovatebot/pre-commit-hooks.git
synced 2026-04-15 02:54:46 +00:00
feat: Initial commit
This commit is contained in:
commit
2484d9ca71
9 changed files with 143 additions and 0 deletions
9
.editorconfig
Normal file
9
.editorconfig
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
4
.github/semantic.yml
vendored
Normal file
4
.github/semantic.yml
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Semantic Commit bot: https://github.com/zeke/semantic-pull-requests
|
||||||
|
|
||||||
|
# Always validate the PR title, and ignore the commits
|
||||||
|
titleOnly: true
|
||||||
56
.github/workflows/tag.yml
vendored
Normal file
56
.github/workflows/tag.yml
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
name: tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
timeout-minutes: 10
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # all tags
|
||||||
|
|
||||||
|
- name: Get Renovate version
|
||||||
|
id: get-renovate-version
|
||||||
|
uses: mikefarah/yq@a0ba20866929f62c3fe4f520f34a5f820d27fd37 # renovate: tag=v4.17.2
|
||||||
|
with:
|
||||||
|
cmd: >-
|
||||||
|
yq eval
|
||||||
|
'.[]|select(.id=="renovate-config-validator")|.additional_dependencies[0]|split("@").[1]'
|
||||||
|
.pre-commit-hooks.yaml
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
run: |
|
||||||
|
TAG=${{ steps.get-renovate-version.outputs.result }}
|
||||||
|
if ! git show-ref --tags "${TAG}" --quiet; then
|
||||||
|
git tag "${TAG}" && git push origin "${TAG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: [tag]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
timeout-minutes: 10
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@f38219332975fe8f9c04cca981d674bf22aea1d3 # renovate: tag=v2.3.1
|
||||||
|
|
||||||
|
- name: Run pre-commit
|
||||||
|
uses: pre-commit/action@9b88afc9cd57fd75b655d5c71bd38146d07135fe # renovate: tag=v2.0.3
|
||||||
|
with:
|
||||||
|
extra_args: --all-files
|
||||||
5
.pre-commit-config.yaml
Normal file
5
.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/maxbrunet/renovate-pre-commit-hooks
|
||||||
|
rev: 31.56.0
|
||||||
|
hooks:
|
||||||
|
- id: renovate-config-validator
|
||||||
7
.pre-commit-hooks.yaml
Normal file
7
.pre-commit-hooks.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
- id: renovate-config-validator
|
||||||
|
name: renovate-config-validator
|
||||||
|
description: Validate Renovate config
|
||||||
|
language: node
|
||||||
|
additional_dependencies: [renovate@31.56.0]
|
||||||
|
entry: renovate-config-validator
|
||||||
|
files: '(^|/).?renovate(?:rc)?(?:\.json5?)?$'
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Maxime Brunet
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
15
README.md
Normal file
15
README.md
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Renovate pre-commit hooks
|
||||||
|
|
||||||
|
A [pre-commit](https://pre-commit.com/) hook to run `renovate-config-validator` when you [reconfigure Renovate via PR](https://docs.renovatebot.com/getting-started/installing-onboarding/#reconfigure-via-pr).
|
||||||
|
|
||||||
|
Even though it is a Node-based hook, it works [without any system-level dependencies](https://pre-commit.com/#node).
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
repos:
|
||||||
|
- repo: github.com/maxbrunet/renovate-pre-commit-hooks
|
||||||
|
rev: 31.56.0
|
||||||
|
hooks:
|
||||||
|
- id: renovate-config-validator
|
||||||
|
```
|
||||||
4
package.json
Normal file
4
package.json
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"name": "dummy_package",
|
||||||
|
"version": "0.0.0"
|
||||||
|
}
|
||||||
22
renovate.json
Normal file
22
renovate.json
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": ["github>renovatebot/.github"],
|
||||||
|
"assignees": ["maxbrunet"],
|
||||||
|
"automergeType": "pr",
|
||||||
|
"prCreation": "immediate",
|
||||||
|
"regexManagers": [
|
||||||
|
{
|
||||||
|
"description": "Update Renovate",
|
||||||
|
"fileMatch": [
|
||||||
|
"^\\.pre-commit-(?:config|hooks)\\.yaml$",
|
||||||
|
"^README\\.md$"
|
||||||
|
],
|
||||||
|
"matchStrings": [
|
||||||
|
"additional_dependencies: \\[renovate@(?<currentValue>.*?)\\]",
|
||||||
|
"rev: (?<currentValue>.*?)\\s"
|
||||||
|
],
|
||||||
|
"depNameTemplate": "renovate",
|
||||||
|
"datasourceTemplate": "npm"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue