From 80a8ed4ee4950d2220eb6eaee0dfaffbb43b8aa1 Mon Sep 17 00:00:00 2001 From: staticdev Date: Mon, 19 Jun 2023 18:52:02 +0200 Subject: [PATCH] Fix broken Yamllint Github Action --- .github/workflows/constraints.txt | 1 + .github/workflows/lint.yml | 37 +++++++++++++++++++++++++++++++ .github/workflows/yamllint.yml | 19 ---------------- README.md | 5 ++--- 4 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/yamllint.yml diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt index 03ee8363..4de836bd 100644 --- a/.github/workflows/constraints.txt +++ b/.github/workflows/constraints.txt @@ -1,3 +1,4 @@ pip==23.1.2 ansible==8.0.0 netaddr==0.8.0 +yamllint==1.32.0 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..a0b5ff8e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,37 @@ +--- +name: Ansible Lint +"on": + pull_request: + push: + schedule: + - cron: "0 7 * * *" + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + # Important: This sets up your GITHUB_WORKSPACE environment variable + - uses: actions/checkout@v3 + + - name: Run ansible-lint + # replace `main` with any valid ref, or tags like `v6` + uses: ansible-community/ansible-lint-action@v6 + + - name: Set up Python 3. + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Upgrade pip + run: | + pip install --constraint=.github/workflows/constraints.txt pip + pip --version + + - name: Upgrade yamllint + run: | + pip install --constraint=.github/workflows/constraints.txt yamllint + + - name: Lint code. + run: | + yamllint . diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml deleted file mode 100644 index b496428e..00000000 --- a/.github/workflows/yamllint.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -## Source: https://github.com/marketplace/actions/yaml-lint -name: Yaml Lint -"on": - pull_request: - push: - schedule: - - cron: "0 7 * * *" - -jobs: - yaml-lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Run yaml-lint - uses: ibiqlik/action-yamllint@v3 - with: - config_file: .yamllint.yml - format: github diff --git a/README.md b/README.md index bf8025d1..5fa766ec 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ -[![Ansible-lint status](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions?workflow=Ansible%20Lint) -[![YAML-lint status](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions/workflows/yamllint.yml/badge.svg)](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions?workflow=Yaml%20Lint) +[![Lint status](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions/workflows/lint.yml/badge.svg)](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions?workflow=Lint) [![Tests for all supported versions](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions/workflows/tests.yml/badge.svg)](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions?workflow=Tests) [![Tests for latest](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions/workflows/tests_latest.yml/badge.svg)](https://github.com/nextcloud/ansible-collection-nextcloud-admin/actions?workflow=Tests%20latest) -# ansible collection for nextcloud administration +# Ansible collection for nextcloud administration This repository hosts the `nextcloud.admin` Ansible Collection (formerly the role `aalaesar.install_nextcloud`).