mirror of
https://github.com/swarm-game/swarm.git
synced 2024-08-17 18:41:02 +03:00
parent
47a8ffe115
commit
a388af6155
27
.github/workflows/yaml-normalization.yml
vendored
Normal file
27
.github/workflows/yaml-normalization.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: YAML normalization
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'data/**.yaml'
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
paths:
|
||||
- 'data/**.yaml'
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
ensure-yaml-normalization:
|
||||
name: Ensure YAML files are normalized
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Setup yq'
|
||||
uses: dcarbone/install-yq-action@v1.1.1
|
||||
with:
|
||||
version: "v4.35.1"
|
||||
download-compressed: true
|
||||
- uses: actions/checkout@v3
|
||||
- name: Normalize
|
||||
run: |
|
||||
scripts/normalize-all-yaml.sh
|
||||
git diff --name-only --exit-code
|
@ -205,7 +205,6 @@
|
||||
#########################################
|
||||
## METAL ##
|
||||
#########################################
|
||||
|
||||
## VEINS
|
||||
- in:
|
||||
- [1, mountain]
|
||||
|
@ -1,6 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
cd $SCRIPT_DIR/..
|
||||
|
||||
find data/scenarios -type f -name '*.yaml' -print0 | xargs -0 --max-args 1 yq --inplace
|
8
scripts/normalize-all-yaml.sh
Executable file
8
scripts/normalize-all-yaml.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
cd $SCRIPT_DIR/..
|
||||
|
||||
find data -type f -name '*.yaml' -print0 | xargs -0 --max-args 1 sed -i -e 's/[[:blank:]]\+$//'
|
||||
|
||||
find data -type f -name '*.yaml' -print0 | xargs -0 --max-args 1 yq --inplace
|
Loading…
Reference in New Issue
Block a user