Skip to content

build(deps): bump tj-actions/changed-files from 38.1.0 to 39.2.4 #915

build(deps): bump tj-actions/changed-files from 38.1.0 to 39.2.4

build(deps): bump tj-actions/changed-files from 38.1.0 to 39.2.4 #915

Workflow file for this run

name: Lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:
name: Create build context
runs-on: ubuntu-22.04
outputs:
matrix-genesis: ${{ steps.matrix-genesis.outputs.config }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Find changed genesis files
id: changed-genesis
uses: tj-actions/[email protected]
with:
separator: ","
files: |
chains/*/genesis.json
- name: Setup matrix (for changed genesis)
id: matrix-genesis
run: |
CONFIG=""
ALL_MODIFIED_FILES="${{ steps.changed-genesis.outputs.all_modified_files }}"
IFS=',' read -r -a GENESISFILES <<< "$ALL_MODIFIED_FILES"
for GENESISFILE in "${GENESISFILES[@]}"; do
APATH=$(dirname ${GENESISFILE})
NETWORK=$(basename ${APATH})
NAME=$(basename ${GENESISFILE})
CONFIG="${CONFIG:+${CONFIG}, }{\"path\": \"${APATH}\", \"network\": \"${NETWORK}\", \"name\": \"${NAME}\"}"
done
echo "config=[${CONFIG}]" >> $GITHUB_OUTPUT
lint-commits:
runs-on: ubuntu-22.04
if: github.actor != 'dependabot[bot]'
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check commits
uses: wagoid/commitlint-github-action@v5
lint-markdown:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Lint markdown files
uses: avto-dev/[email protected]
with:
args: "**/*.md"
lint-yaml:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Lint yaml files
uses: ibiqlik/[email protected]
lint-json:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Lint json files
run: |
sudo apt install -y jsonlint
find ./ -type f -name "*.json" -exec sh -c '
for file do
if ! jsonlint-php -q "$file"; then
echo "❌ $file"
export FAILED=1
else
echo "✅ $file"
fi
done
if [ "${FAILED}" = "1" ]; then
exit 1
fi
' sh {} +
lint-genesis:
if: needs.prepare.outputs.matrix-genesis != '[]'
runs-on: ubuntu-22.04
needs: prepare
strategy:
matrix:
context: ${{ fromJson(needs.prepare.outputs.matrix-genesis) }}
fail-fast: false
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Check genesis files
run: |
echo "🔎 Checking 'okp4-${{ matrix.context.network }}' genesis"
docker run --rm -v ${GITHUB_WORKSPACE}/${{ matrix.context.path }}/${{ matrix.context.name }}:/genesis.json okp4/okp4d:`cat ./chains/${{ matrix.context.network }}/version.txt` validate-genesis /genesis.json