Skip to content

Commit 0ccd06e

Browse files
Merge pull request #1 from suzuki-shunsuke/feat/first-pr
feat: implement basic function
2 parents 8802954 + e03c06b commit 0ccd06e

File tree

6 files changed

+126
-0
lines changed

6 files changed

+126
-0
lines changed

.github/workflows/actionlint.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: actionlint
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- .github/**
8+
pull_request:
9+
branches: [main]
10+
paths:
11+
- .github/**
12+
jobs:
13+
default:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: aquaproj/aqua-installer@v0.4.0
18+
with:
19+
aqua_version: v0.8.13
20+
- run: actionlint

.github/workflows/test.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: test
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
jobs:
9+
default:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: ./

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
11
# github-action-renovate-config-validator
2+
23
GitHub Actions for renovate-config-validator
4+
5+
## Input and Output
6+
7+
Please see [action.yaml](action.yaml)
8+
9+
## Example
10+
11+
```yaml
12+
steps:
13+
- uses: suzuki-shunsuke/github-action-renovate-config-validator
14+
```
15+
16+
You can specify renovate-config-validator version and configuration file path.
17+
18+
```yaml
19+
steps:
20+
- uses: suzuki-shunsuke/github-action-renovate-config-validator
21+
with:
22+
validator_version: "31.15.0"
23+
config_file_path: renovate.json5
24+
```
25+
26+
## Liencse
27+
28+
[MIT](LICENSE)

action.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: renovate-config-validator
2+
description: |
3+
Validate Renovate Configuration with renovate-config-validator.
4+
npx is required.
5+
inputs:
6+
validator_version:
7+
description: 'version of renovate-config-validator. By default, the latest version is used.'
8+
required: false
9+
config_file_path:
10+
description: |
11+
Renovate Configuration file
12+
By default, the following files are validated.
13+
14+
* .github/renovate.json
15+
* .github/renovate.json5
16+
* .gitlab/renovate.json
17+
* .gitlab/renovate.json5
18+
* .renovaterc.json
19+
* renovate.json
20+
* renovate.json5
21+
* .renovaterc
22+
required: false
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Validate Renovate Configuration with renovate-config-validator
27+
run: |
28+
pkg=renovate
29+
if [ -n "${{ inputs.validator_version }}" ]; then
30+
pkg=renovate@${{ inputs.validator_version }}
31+
fi
32+
if [ -n "${{ inputs.config_file_path }}" ]; then
33+
echo "===> RENOVATE_CONFIG_FILE=\"${{ inputs.config_file_path }}\" npx --package \"$pkg\" -c renovate-config-validator" >&2
34+
RENOVATE_CONFIG_FILE="${{ inputs.config_file_path }}" npx --package "$pkg" -c renovate-config-validator
35+
exit 0
36+
fi
37+
missing=true
38+
for file in .github/renovate.json .github/renovate.json5 .gitlab/renovate.json .gitlab/renovate.json5 .renovaterc.json renovate.json renovate.json5 .renovaterc; do
39+
if [ -f "$file" ]; then
40+
missing=false
41+
echo "===> RENOVATE_CONFIG_FILE=\"$file\" npx --package \"$pkg\" -c renovate-config-validator" >&2
42+
RENOVATE_CONFIG_FILE="$file" npx --package "$pkg" -c renovate-config-validator
43+
fi
44+
done
45+
if [ "$missing" = "true" ]; then
46+
echo "===> No configuration file is found" >&2
47+
fi
48+
shell: bash

aqua.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# aqua - Declarative CLI Version Manager
3+
# https://aquaproj.github.io/
4+
registries:
5+
- type: standard
6+
ref: v0.12.4 # renovate: depName=aquaproj/aqua-registry
7+
8+
packages:
9+
- name: rhysd/actionlint@v1.6.8

renovate.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": [
3+
"config:base",
4+
"github>aquaproj/aqua-renovate-config:0.1.8"
5+
],
6+
"automerge": true,
7+
"major": {
8+
"automerge": false
9+
}
10+
}

0 commit comments

Comments
 (0)