Skip to content

Commit

Permalink
Merge pull request #1409 from mashehu/dev
Browse files Browse the repository at this point in the history
add github action for yamllint
  • Loading branch information
maxulysse authored Feb 11, 2022
2 parents e8fdf75 + fde544f commit 4cb41f9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/push_dockerhub_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ jobs:
run: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
docker push nfcore/tools:dev
6 changes: 3 additions & 3 deletions .github/workflows/tools-api-docs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
dir:
- latest
- ${{ github.event.release.tag_name }}
dir:
- latest
- ${{ github.event.release.tag_name }}
steps:
- name: Check out source-code repository
uses: actions/checkout@v2
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint YAML
on: [push, pull_request]
jobs:
YAML:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
- name: Install yaml-lint
run: npm install -g yaml-lint
- name: Run yaml-lint
run: yamllint $(find ${GITHUB_WORKSPACE} -type f -name "*.yml" -o -name "*.yaml") -c ${GITHUB_WORKSPACE}/.yamllint.yml

# If the above check failed, post a comment on the PR explaining the failure
- name: Post PR comment
if: failure()
uses: mshick/add-pr-comment@v1
with:
message: |
## YAML linting is failing
To keep the code consistent with lots of contributors, we run automated code consistency checks.
To fix this CI test, please run:
* Install `yaml-lint`
* [Install `npm`](https://www.npmjs.com/get-npm) then [install `yaml-lint`](https://www.npmjs.com/package/yaml-lint) (`npm install -g yaml-lint`)
* Fix the markdown errors
* Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml") -c ./.yamllint.yml`
* Fix any reported errors in your YAML files
Once you push these changes the test should pass, and you can hide this comment :+1:
We highly recommend setting up yaml-lint in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help!
Thanks again for your contribution!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false
3 changes: 2 additions & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
extends: default

ignore: |
nf_core/*-template/
rules:
document-start: disable
line-length: disable
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Add retry strategy for AWS megatests after releasing [nf-core/tower-action v2.2](https://github.com/nf-core/tower-action/releases/tag/v2.2)
* Update igenomes path to the `BWAIndex` to fetch the whole `version0.6.0` folder instead of only the `genome.fa` file
* Remove pinned Node version in the GitHub Actions workflows, to fix errors with `markdownlint`
* Add yamllint GitHub Action.
* Add `.yamllint.yml` to avoid line length and document start errors ([#1407](https://github.com/nf-core/tools/issues/1407))

## General
Expand Down

0 comments on commit 4cb41f9

Please sign in to comment.