Skip to content

Commit

Permalink
Merge pull request #1 from suzuki-shunsuke/feat/first-pr
Browse files Browse the repository at this point in the history
feat: implement basic function
  • Loading branch information
suzuki-shunsuke authored Jan 4, 2022
2 parents 8802954 + e03c06b commit 0ccd06e
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: actionlint
on:
push:
branches: [main]
paths:
- .github/**
pull_request:
branches: [main]
paths:
- .github/**
jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: aquaproj/[email protected]
with:
aqua_version: v0.8.13
- run: actionlint
13 changes: 13 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: test
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# github-action-renovate-config-validator

GitHub Actions for renovate-config-validator

## Input and Output

Please see [action.yaml](action.yaml)

## Example

```yaml
steps:
- uses: suzuki-shunsuke/github-action-renovate-config-validator
```
You can specify renovate-config-validator version and configuration file path.
```yaml
steps:
- uses: suzuki-shunsuke/github-action-renovate-config-validator
with:
validator_version: "31.15.0"
config_file_path: renovate.json5
```
## Liencse
[MIT](LICENSE)
48 changes: 48 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: renovate-config-validator
description: |
Validate Renovate Configuration with renovate-config-validator.
npx is required.
inputs:
validator_version:
description: 'version of renovate-config-validator. By default, the latest version is used.'
required: false
config_file_path:
description: |
Renovate Configuration file
By default, the following files are validated.
* .github/renovate.json
* .github/renovate.json5
* .gitlab/renovate.json
* .gitlab/renovate.json5
* .renovaterc.json
* renovate.json
* renovate.json5
* .renovaterc
required: false
runs:
using: composite
steps:
- name: Validate Renovate Configuration with renovate-config-validator
run: |
pkg=renovate
if [ -n "${{ inputs.validator_version }}" ]; then
pkg=renovate@${{ inputs.validator_version }}
fi
if [ -n "${{ inputs.config_file_path }}" ]; then
echo "===> RENOVATE_CONFIG_FILE=\"${{ inputs.config_file_path }}\" npx --package \"$pkg\" -c renovate-config-validator" >&2
RENOVATE_CONFIG_FILE="${{ inputs.config_file_path }}" npx --package "$pkg" -c renovate-config-validator
exit 0
fi
missing=true
for file in .github/renovate.json .github/renovate.json5 .gitlab/renovate.json .gitlab/renovate.json5 .renovaterc.json renovate.json renovate.json5 .renovaterc; do
if [ -f "$file" ]; then
missing=false
echo "===> RENOVATE_CONFIG_FILE=\"$file\" npx --package \"$pkg\" -c renovate-config-validator" >&2
RENOVATE_CONFIG_FILE="$file" npx --package "$pkg" -c renovate-config-validator
fi
done
if [ "$missing" = "true" ]; then
echo "===> No configuration file is found" >&2
fi
shell: bash
9 changes: 9 additions & 0 deletions aqua.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
registries:
- type: standard
ref: v0.12.4 # renovate: depName=aquaproj/aqua-registry

packages:
- name: rhysd/[email protected]
10 changes: 10 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": [
"config:base",
"github>aquaproj/aqua-renovate-config:0.1.8"
],
"automerge": true,
"major": {
"automerge": false
}
}

0 comments on commit 0ccd06e

Please sign in to comment.