Skip to content

Commit

Permalink
GitHub: Updates and splits the super-linter and yaml linter. (awsdocs…
Browse files Browse the repository at this point in the history
  • Loading branch information
beqqrry-aws authored and max-webster committed Mar 15, 2024
1 parent 0d70deb commit 2bbc0f5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 35 deletions.
45 changes: 10 additions & 35 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
# This workflow executes several linters on changed files based on languages used in your code base whenever
# you push a code or open a pull request.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/github/super-linter
# This workflow uses https://github.com/github/super-linter

name: Lint Code Base

on:
push:
branches: [main]
pull_request:
branches: [main]

# Lets you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
run-lint:
name: Lint Multiple
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout files
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

sparse-checkout: |
.github
php
python
ruby
kotlin
- name: Lint Code Base
uses: github/super-linter@v4
env:
Expand All @@ -37,22 +31,3 @@ jobs:
VALIDATE_PYTHON_BLACK: true
VALIDATE_RUBY: true
VALIDATE_KOTLIN: true
yamllint:
name: Lint Yaml
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: checkout repo content
uses: actions/checkout@v3 # checkout the repository content to github runner.
- name: setup python
uses: actions/setup-python@v3
with:
python-version: 3.11 #install the python needed
- name: Install dependencies
run: >-
python3 -m pip install -r .tools/base_requirements.txt
- name: Lint metadata files
run: >-
yamllint --format standard -c .tools/validation/.yamllint.yaml .doc_gen/metadata
36 changes: 36 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint Metadata Yaml

on:
pull_request:
workflow_dispatch:

jobs:
yamllint:
name: Lint Yaml
runs-on: ubuntu-latest
steps:
- name: Checkout files
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
.doc_gen/metadata
.tools
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: ".doc_gen/metadata/**/*.{yml,yaml}"
- name: Setup Python
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install dependencies
if: steps.changed-files.outputs.any_changed == 'true'
run: >-
python3 -m pip install -r .tools/base_requirements.txt
- name: Lint metadata files
if: steps.changed-files.outputs.any_changed == 'true'
run: >-
yamllint --format standard -c .tools/validation/.yamllint.yaml .doc_gen/metadata

0 comments on commit 2bbc0f5

Please sign in to comment.