mirror of
https://github.com/karancode/yamllint-github-action.git
synced 2024-08-16 10:19:48 +02:00
Add to GitHub Actions workflows Linting ourselves with yamllint (#10)
* Linting ourselves in yamllint * Add to GitHub Actions workflows Linting ourselves with yamllint
This commit is contained in:
parent
dd59165b84
commit
8aaa73d411
5 changed files with 52 additions and 25 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
version: 1
|
version: 1
|
||||||
update_configs:
|
update_configs:
|
||||||
- package_manager: "docker"
|
- package_manager: "docker"
|
||||||
|
|
33
.github/workflows/linting.yml
vendored
Normal file
33
.github/workflows/linting.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
---
|
||||||
|
name: linting
|
||||||
|
on:
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Markdownlint:
|
||||||
|
runs-on: 'ubuntu-latest'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Markdown Lint
|
||||||
|
uses: actionshub/markdownlint@v1.0.0
|
||||||
|
|
||||||
|
Dockerfilelint:
|
||||||
|
runs-on: 'ubuntu-latest'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Dockerfile Lint
|
||||||
|
uses: burdzwastaken/hadolint-action@1.6.0
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
HADOLINT_ACTION_DOCKERFILE_FOLDER: .
|
||||||
|
|
||||||
|
Yamllint:
|
||||||
|
runs-on: 'ubuntu-latest'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: YAML Lint
|
||||||
|
uses: karancode/yamllint-github-action@master
|
||||||
|
with:
|
||||||
|
yamllint_comment: true
|
||||||
|
env:
|
||||||
|
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
35
.github/workflows/test.yml
vendored
35
.github/workflows/test.yml
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
name: "Continuous Integration"
|
name: "Continuous Integration"
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -7,31 +8,15 @@ on:
|
||||||
- cron: '22 22 * * 5'
|
- cron: '22 22 * * 5'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
|
||||||
runs-on: 'ubuntu-latest'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Markdown Lint
|
|
||||||
uses: actionshub/markdownlint@v1.0.0
|
|
||||||
|
|
||||||
- name: Dockerfile Lint
|
|
||||||
uses: burdzwastaken/hadolint-action@1.6.0
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
HADOLINT_ACTION_DOCKERFILE_FOLDER: .
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install bats
|
||||||
- name: Install bats
|
run: sudo apt-get -y install bats > /dev/null
|
||||||
run: sudo apt-get -y install bats > /dev/null
|
- name: Run CI script
|
||||||
|
run: ./tests/run.bats
|
||||||
- name: Run CI script
|
- name: Run action
|
||||||
run: ./tests/run.bats
|
uses: ./
|
||||||
|
with:
|
||||||
- name: Run action
|
yamllint_file_or_dir: "./tests/data/single_files/file2.yml"
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
yamllint_file_or_dir: "./tests/data/single_files/file2.yml"
|
|
||||||
|
|
7
.yamllint
Normal file
7
.yamllint
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
extends: default
|
||||||
|
|
||||||
|
rules:
|
||||||
|
line-length: disable
|
||||||
|
truthy:
|
||||||
|
check-keys: false
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
# action.yaml
|
# action.yaml
|
||||||
name: 'Yamllint Github Action'
|
name: 'Yamllint Github Action'
|
||||||
author: 'karancode <karanthanvi0@gmail.com>'
|
author: 'karancode <karanthanvi0@gmail.com>'
|
||||||
|
|
Loading…
Reference in a new issue