Skip to content

Commit

Permalink
Add settings and guide validation (#3)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Castaño Sánchez <danielcastanosanchez@icloud.com>
Signed-off-by: Sergio Castaño Sánchez <sergiocastanosanchez@icloud.com>
Co-authored-by: Daniel Castaño Sánchez <danielcastanosanchez@icloud.com>
Co-authored-by: Sergio Castaño Sánchez <sergiocastanosanchez@icloud.com>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent 2c79a80 commit 7f299c4
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 12 deletions.
58 changes: 53 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,56 @@
# Landscape2 validate action

This GitHub action checks if the provided landscape data file (`landscape.yml`) is valid.
This GitHub action checks if the provided landscape datasource file is valid.

## Usage

### Validate data file

```yaml
name: Validate

on:
push:
branches:
- main

jobs:
validate-landscape-data:
runs-on: ubuntu-latest
name: "Validate landscape data file"
steps:
- uses: actions/checkout@v3
- uses: cncf/landscape2-validate-action@v2
with:
target_kind: data
target_path: ./landscape.yml
```
### Validate settings file
```yaml
name: Validate

on:
push:
branches:
- main

jobs:

validate-landscape-settings:
runs-on: ubuntu-latest
name: "Validate landscape settings file"
steps:
- uses: actions/checkout@v3
- uses: cncf/landscape2-validate-action@v2
with:
target_kind: settings
target_path: ./settings.yml
```
### Validate guide file
```yaml
name: Validate

Expand All @@ -13,14 +60,15 @@ on:
- main

jobs:
validate-landscape:
validate-landscape-guide:
runs-on: ubuntu-latest
name: "Validate landscape.yml file"
name: "Validate landscape guide file"
steps:
- uses: actions/checkout@v3
- uses: cncf/landscape2-validate-action@v1
- uses: cncf/landscape2-validate-action@v2
with:
data_file: ./landscape.yml
target_kind: guide
target_path: ./guide.yml
```
## Contributing
Expand Down
15 changes: 8 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: Landscape2 validate action

inputs:
data_file:
description: 'Landscape data file local path'
target_kind:
description: 'Kind of file to validate'
required: true
target_path:
description: 'Path of file to validate'
required: true

runs:
using: 'docker'
image: 'docker://public.ecr.aws/g6m3a0y9/landscape2'
entrypoint: landscape2
entrypoint: /landscape2-validate.sh
args:
- validate
- data
- --data-file
- ${{ inputs.data_file }}
- ${{ inputs.target_kind }}
- ${{ inputs.target_path }}

0 comments on commit 7f299c4

Please sign in to comment.